Skip to content

Commit

Permalink
src/gui/mainwindow.cpp: init pal variable with the standard palette
Browse files Browse the repository at this point in the history
Fixes a bug where just clicking "Apply" in the Interface settings
alternates the UI theme between System and the selected theme on some
platforms because the QPalette variable `pal` does not get properly
populated.

Closes #244
  • Loading branch information
precondition committed Oct 27, 2024
1 parent b060a0e commit 3e6a5cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void MainWindow::initTheme()
settings.beginGroup(Constants::Settings::Interface::GROUP);

/* Set Palette */
QPalette pal;
QPalette pal{QApplication::style()->standardPalette()};
Constants::Theme theme = static_cast<Constants::Theme>(settings.value(
Constants::Settings::Interface::THEME,
static_cast<int>(Constants::Settings::Interface::THEME_DEFAULT)
Expand Down

0 comments on commit 3e6a5cd

Please sign in to comment.