aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo78913 <leo3758@riseup.net>2022-11-14 19:59:26 -0300
committerRedson <redson@riseup.net>2022-11-14 21:10:48 -0300
commit0e916244f03cd8bd296f6cc4fe2be34a745ecab4 (patch)
tree55544bed75af61dcfade4b9b34c76ed848b8479c
parent1e4ee02cbc0f44f390b33b5b85418f4eadffbae4 (diff)
downloadPrismLauncher-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.cpp20
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);
}