Browse Source

Prevent invalid theme names and use dark theme if one is found

pull/112/head
Duke Leto 2 years ago
parent
commit
4b35ff58dc
  1. 8
      src/mainwindow.cpp

8
src/mainwindow.cpp

@ -1916,7 +1916,13 @@ void MainWindow::slot_change_theme(QString& theme_name)
{
qDebug() << __func__ << ": theme_name=" << theme_name;
Settings::getInstance()->set_theme_name(theme_name);
if (theme_name == "dark" || theme_name == "default" || theme_name == "light" ||
theme_name == "midnight" || theme_name == "blue") {
Settings::getInstance()->set_theme_name(theme_name);
} else {
qDebug() << __func__ << ": ignoring invalid theme_name=" << theme_name;
Settings::getInstance()->set_theme_name("dark");
}
// Include css
QString saved_theme_name;

Loading…
Cancel
Save