From eeaa1bcaf3e45438be4257c4cf2464abc9b0dc26 Mon Sep 17 00:00:00 2001 From: tomboylover93 <95257311+tomboylover93@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:38:08 -0300 Subject: [PATCH] cleanup: Remove unused and/or incorrect code --- src/qt_gui/main_window.h | 1 - src/qt_gui/main_window_themes.cpp | 16 +++++++--------- src/qt_gui/main_window_ui.h | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/qt_gui/main_window.h b/src/qt_gui/main_window.h index 615b7f0a7..b1f1b9667 100644 --- a/src/qt_gui/main_window.h +++ b/src/qt_gui/main_window.h @@ -64,7 +64,6 @@ private: void SetLastUsedTheme(); void SetLastIconSizeBullet(); void SetUiIcons(bool isWhite); - void RepaintWidgets(); void InstallPkg(); void BootGame(); void AddRecentFiles(QString filePath); diff --git a/src/qt_gui/main_window_themes.cpp b/src/qt_gui/main_window_themes.cpp index c2566541f..00cf59591 100644 --- a/src/qt_gui/main_window_themes.cpp +++ b/src/qt_gui/main_window_themes.cpp @@ -6,12 +6,12 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { QPalette themePalette; - static QPalette s_unthemed_palette; - static bool s_unthemed_style_name_set; + static QPalette s_system_palette; + static bool s_system_style_name_set; - if (!s_unthemed_style_name_set) { - s_unthemed_style_name_set = true; - s_unthemed_palette = QApplication::palette(); + if (!s_system_style_name_set) { + s_system_style_name_set = true; + s_system_palette = QApplication::palette(); } switch (theme) { @@ -157,9 +157,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { "border-radius: 4px; padding: 5px; }" "QLineEdit:focus {" "border: 1px solid; }"); - qApp->setPalette(s_unthemed_palette); + qApp->setPalette(s_system_palette); qApp->setStyleSheet(QString()); - qApp->setStyle(QApplication::style()->objectName()); break; case Theme::SystemLight: mw_searchbar->setStyleSheet("QLineEdit {" @@ -167,9 +166,8 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) { "border-radius: 4px; padding: 5px; }" "QLineEdit:focus {" "border: 1px solid; }"); - qApp->setPalette(s_unthemed_palette); + qApp->setPalette(s_system_palette); qApp->setStyleSheet(QString()); - qApp->setStyle(QApplication::style()->objectName()); break; } } \ No newline at end of file diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index 866fed445..9723c9012 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -165,7 +165,7 @@ public: setThemeGruvbox->setObjectName("setThemeGruvbox"); setThemeGruvbox->setCheckable(true); setThemeSystemDark = new QAction(MainWindow); - setThemeSystemDark->setObjectName("setThemeSystem"); + setThemeSystemDark->setObjectName("setThemeSystemDark"); setThemeSystemDark->setCheckable(true); setThemeSystemLight = new QAction(MainWindow); setThemeSystemLight->setObjectName("setThemeSystemLight");