style: add Tokyo Night theme (#1811)

* style: add Tokyo Night theme

* clang-format: Update main_window_themes.h
This commit is contained in:
tomboylover93
2024-12-28 12:09:33 -03:00
committed by GitHub
parent a8b4e14bf5
commit e8b0fdd6cc
4 changed files with 43 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ void MainWindow::CreateActions() {
m_theme_act_group->addAction(ui->setThemeBlue);
m_theme_act_group->addAction(ui->setThemeViolet);
m_theme_act_group->addAction(ui->setThemeGruvbox);
m_theme_act_group->addAction(ui->setThemeTokyoNight);
}
void MainWindow::AddUiWidgets() {
@@ -559,6 +560,14 @@ void MainWindow::CreateConnects() {
isIconBlack = false;
}
});
connect(ui->setThemeTokyoNight, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::TokyoNight, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::TokyoNight));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
}
});
}
void MainWindow::StartGame() {
@@ -934,6 +943,11 @@ void MainWindow::SetLastUsedTheme() {
isIconBlack = false;
SetUiIcons(false);
break;
case Theme::TokyoNight:
ui->setThemeTokyoNight->setChecked(true);
isIconBlack = false;
SetUiIcons(false);
break;
}
}