diff options
author | leo78913 <leo3758@riseup.net> | 2022-11-14 19:59:26 -0300 |
---|---|---|
committer | Redson <redson@riseup.net> | 2022-11-14 21:10:48 -0300 |
commit | 0e916244f03cd8bd296f6cc4fe2be34a745ecab4 (patch) | |
tree | 55544bed75af61dcfade4b9b34c76ed848b8479c | |
parent | 1e4ee02cbc0f44f390b33b5b85418f4eadffbae4 (diff) | |
download | PrismLauncher-0e916244f03cd8bd296f6cc4fe2be34a745ecab4.tar.gz PrismLauncher-0e916244f03cd8bd296f6cc4fe2be34a745ecab4.tar.bz2 PrismLauncher-0e916244f03cd8bd296f6cc4fe2be34a745ecab4.zip |
feat: Add themes and their logic.
Signed-off-by: leo78913 <leo3758@riseup.net>
-rw-r--r-- | launcher/ui/MainWindow.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 8d5e0c83..cbdb2b8f 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -106,6 +106,7 @@ #include "ui/dialogs/UpdateDialog.h" #include "ui/dialogs/EditAccountDialog.h" #include "ui/dialogs/ExportInstanceDialog.h" +#include "ui/themes/ITheme.h" #include "UpdateController.h" #include "KonamiCode.h" @@ -1313,6 +1314,25 @@ void MainWindow::updateThemeMenu() themeMenu = new QMenu(this); } + auto themes = APPLICATION->getValidApplicationThemes(); + + QActionGroup* ThemesGroup = new QActionGroup( this ); + + for (int i = 0; i < themes.size(); i++) + { + + auto *theme = themes[i]; + QAction * themeAction = themeMenu->addAction(theme->name()); + + themeAction->setCheckable(true); + themeAction->setActionGroup(ThemesGroup); + + connect(themeAction, &QAction::triggered, [theme]() { + APPLICATION->setApplicationTheme(theme->name().toLower(),false); + + }); + } + ui->actionChangeTheme->setMenu(themeMenu); } |