feat: Add themes and their logic.
Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
parent
1e4ee02cbc
commit
0e916244f0
@ -106,6 +106,7 @@
|
|||||||
#include "ui/dialogs/UpdateDialog.h"
|
#include "ui/dialogs/UpdateDialog.h"
|
||||||
#include "ui/dialogs/EditAccountDialog.h"
|
#include "ui/dialogs/EditAccountDialog.h"
|
||||||
#include "ui/dialogs/ExportInstanceDialog.h"
|
#include "ui/dialogs/ExportInstanceDialog.h"
|
||||||
|
#include "ui/themes/ITheme.h"
|
||||||
|
|
||||||
#include "UpdateController.h"
|
#include "UpdateController.h"
|
||||||
#include "KonamiCode.h"
|
#include "KonamiCode.h"
|
||||||
@ -1313,6 +1314,25 @@ void MainWindow::updateThemeMenu()
|
|||||||
themeMenu = new QMenu(this);
|
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);
|
ui->actionChangeTheme->setMenu(themeMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user