From aa3ea79f94887aedc91c52860d5a7b6557900a6f Mon Sep 17 00:00:00 2001 From: Redson Date: Tue, 15 Nov 2022 05:38:31 -0300 Subject: [PATCH] fix: Check the current theme box on startup. Signed-off-by: Redson --- launcher/ui/MainWindow.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index a00fb402..f8a37596 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1305,12 +1305,9 @@ void MainWindow::updateThemeMenu() { QMenu *themeMenu = ui->actionChangeTheme->menu(); - if (themeMenu) - { + if (themeMenu) { themeMenu->clear(); - } - else - { + } else { themeMenu = new QMenu(this); } @@ -1320,11 +1317,13 @@ void MainWindow::updateThemeMenu() for (int i = 0; i < themes.size(); i++) { - auto *theme = themes[i]; QAction * themeAction = themeMenu->addAction(theme->name()); themeAction->setCheckable(true); + if (APPLICATION->settings()->get("ApplicationTheme").toString() == theme->id()) { + themeAction->setChecked(true); + } themeAction->setActionGroup(ThemesGroup); connect(themeAction, &QAction::triggered, [theme]() {