Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test wallpaper cursor add settings #340

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/test_window_crusor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <QPlatformSurfaceEvent>
#include <QDebug>
#include <QTimer>
#include <QSettings>

#include "personalization_manager.h"

Expand Down Expand Up @@ -48,11 +49,19 @@ class TestWindow : public QRasterWindow
return;

if (rect1.contains(ev->position())) {
cursor_context->set_theme("Breeze_Light");
QString config = "test_config.ini";
QSettings settings(config, QSettings::IniFormat);
QString theme = settings.value("Cursor/theme", "Breeze_Light").toString();
qDebug() << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" << theme;
cursor_context->set_theme(theme);
cursor_context->commit();
}
else if (rect2.contains(ev->position())) {
cursor_context->set_size(32);
QString config = "test_config.ini";
QSettings settings(config, QSettings::IniFormat);
int cursor_size = settings.value("Cursor/size", 32).toInt();
qDebug() << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" << cursor_size;
cursor_context->set_size(cursor_size);
cursor_context->commit();
}
else if (rect3.contains(ev->position()))
Expand Down
5 changes: 5 additions & 0 deletions tests/test_window_crusor/test_config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Cursor]
theme=user123
size=16
[Wallpaepr]
path=/home/uos/Pictures/Wallpapers/Autumn_in_Kanas_by_Wang_Jinyu.jpg
6 changes: 5 additions & 1 deletion tests/test_xdgport_wallpaper/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <QDBusConnection>
#include <QDBusArgument>
#include <QVariantMap>
#include <QSettings>

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
Expand All @@ -30,9 +31,12 @@

void MainWindow::setWallpaper()
{
QString app_id = "G4";

Check warning on line 34 in tests/test_xdgport_wallpaper/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Variable 'app_id' is assigned a value that is never used.
QString parent_window = "";
QString uri = "/home/uos/Pictures/Wallpapers/abc-123.jpg";
QString config = "test_config.ini";
QSettings settings(config, QSettings::IniFormat);
QString uri = settings.value("Wallpaper/path", "/home/uos/Pictures/Wallpapers/abc-123.jpg").toString();
qDebug() << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=========" << uri;

QVariantMap options;
options.insert("output", "X11-2");
Expand Down
Loading