fix: Check the current theme box on startup.

Signed-off-by: Redson <redson@riseup.net>
This commit is contained in:
Redson 2022-11-15 05:38:31 -03:00
parent ef53455b66
commit aa3ea79f94
No known key found for this signature in database
GPG Key ID: A55CD2880240ABD7

View File

@ -1305,12 +1305,9 @@ void MainWindow::updateThemeMenu()
{ {
QMenu *themeMenu = ui->actionChangeTheme->menu(); QMenu *themeMenu = ui->actionChangeTheme->menu();
if (themeMenu) if (themeMenu) {
{
themeMenu->clear(); themeMenu->clear();
} } else {
else
{
themeMenu = new QMenu(this); themeMenu = new QMenu(this);
} }
@ -1320,11 +1317,13 @@ void MainWindow::updateThemeMenu()
for (int i = 0; i < themes.size(); i++) for (int i = 0; i < themes.size(); i++)
{ {
auto *theme = themes[i]; auto *theme = themes[i];
QAction * themeAction = themeMenu->addAction(theme->name()); QAction * themeAction = themeMenu->addAction(theme->name());
themeAction->setCheckable(true); themeAction->setCheckable(true);
if (APPLICATION->settings()->get("ApplicationTheme").toString() == theme->id()) {
themeAction->setChecked(true);
}
themeAction->setActionGroup(ThemesGroup); themeAction->setActionGroup(ThemesGroup);
connect(themeAction, &QAction::triggered, [theme]() { connect(themeAction, &QAction::triggered, [theme]() {