aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-10 13:28:57 -0300
committerGitHub <noreply@github.com>2023-01-10 13:28:57 -0300
commit96d5438633807488eafb577d583d5400d0d91f08 (patch)
tree882937680c9accd3b2de61bc1625532b95b8eae9
parent976e550aa7291f22f5011178ab824a937f89d11a (diff)
parent668b19d11948bedeff6908d76d63f5a5fad4eb02 (diff)
downloadPrismLauncher-96d5438633807488eafb577d583d5400d0d91f08.tar.gz
PrismLauncher-96d5438633807488eafb577d583d5400d0d91f08.tar.bz2
PrismLauncher-96d5438633807488eafb577d583d5400d0d91f08.zip
Merge pull request #249 from TayouVR/theme-selector-first-time-wizard
-rw-r--r--launcher/Application.cpp26
-rw-r--r--launcher/Application.h4
-rw-r--r--launcher/CMakeLists.txt6
-rw-r--r--launcher/ui/MainWindow.cpp34
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp110
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui166
-rw-r--r--launcher/ui/setupwizard/SetupWizard.cpp3
-rw-r--r--launcher/ui/setupwizard/ThemeWizardPage.cpp70
-rw-r--r--launcher/ui/setupwizard/ThemeWizardPage.h43
-rw-r--r--launcher/ui/setupwizard/ThemeWizardPage.ui371
-rw-r--r--launcher/ui/themes/CustomTheme.cpp31
-rw-r--r--launcher/ui/themes/ITheme.cpp40
-rw-r--r--launcher/ui/themes/ITheme.h48
-rw-r--r--launcher/ui/themes/SystemTheme.cpp21
-rw-r--r--launcher/ui/themes/SystemTheme.h44
-rw-r--r--launcher/ui/themes/ThemeManager.cpp293
-rw-r--r--launcher/ui/themes/ThemeManager.h109
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.cpp150
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.h77
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.ui132
20 files changed, 1233 insertions, 545 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 9d528d7a..ed8d8d2c 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -66,6 +66,7 @@
#include "ui/setupwizard/LanguageWizardPage.h"
#include "ui/setupwizard/JavaWizardPage.h"
#include "ui/setupwizard/PasteWizardPage.h"
+#include "ui/setupwizard/ThemeWizardPage.h"
#include "ui/dialogs/CustomMessageBox.h"
@@ -497,7 +498,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Theming
m_settings->registerSetting("IconTheme", QString("pe_colored"));
- m_settings->registerSetting("ApplicationTheme", QString("system"));
+ m_settings->registerSetting("ApplicationTheme", QString());
m_settings->registerSetting("BackgroundCat", QString("kitteh"));
// Remembered state
@@ -846,10 +847,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
});
{
- setIconTheme(settings()->get("IconTheme").toString());
- qDebug() << "<> Icon theme set.";
- setApplicationTheme(settings()->get("ApplicationTheme").toString(), true);
- qDebug() << "<> Application theme set.";
+ applyCurrentlySelectedTheme();
}
updateCapabilities();
@@ -892,7 +890,8 @@ bool Application::createSetupWizard()
return false;
}();
bool pasteInterventionRequired = settings()->get("PastebinURL") != "";
- bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired;
+ bool themeInterventionRequired = settings()->get("ApplicationTheme") == "";
+ bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired || themeInterventionRequired;
if(wizardRequired)
{
@@ -911,6 +910,12 @@ bool Application::createSetupWizard()
{
m_setupWizard->addPage(new PasteWizardPage(m_setupWizard));
}
+
+ if (themeInterventionRequired)
+ {
+ settings()->set("ApplicationTheme", QString("system")); // set default theme after going into theme wizard
+ m_setupWizard->addPage(new ThemeWizardPage(m_setupWizard));
+ }
connect(m_setupWizard, &QDialog::finished, this, &Application::setupWizardFinished);
m_setupWizard->show();
return true;
@@ -1118,9 +1123,14 @@ QList<ITheme*> Application::getValidApplicationThemes()
return m_themeManager->getValidApplicationThemes();
}
-void Application::setApplicationTheme(const QString& name, bool initial)
+void Application::applyCurrentlySelectedTheme()
+{
+ m_themeManager->applyCurrentlySelectedTheme();
+}
+
+void Application::setApplicationTheme(const QString& name)
{
- m_themeManager->setApplicationTheme(name, initial);
+ m_themeManager->setApplicationTheme(name);
}
void Application::setIconTheme(const QString& name)
diff --git a/launcher/Application.h b/launcher/Application.h
index 7884227a..a7938629 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -120,9 +120,11 @@ public:
void setIconTheme(const QString& name);
+ void applyCurrentlySelectedTheme();
+
QList<ITheme*> getValidApplicationThemes();
- void setApplicationTheme(const QString& name, bool initial);
+ void setApplicationTheme(const QString& name);
shared_qobject_ptr<UpdateChecker> updateChecker() {
return m_updateChecker;
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index 57480671..74b7b212 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -683,6 +683,8 @@ SET(LAUNCHER_SOURCES
ui/setupwizard/LanguageWizardPage.h
ui/setupwizard/PasteWizardPage.cpp
ui/setupwizard/PasteWizardPage.h
+ ui/setupwizard/ThemeWizardPage.cpp
+ ui/setupwizard/ThemeWizardPage.h
# GUI - themes
ui/themes/FusionTheme.cpp
@@ -922,6 +924,8 @@ SET(LAUNCHER_SOURCES
ui/widgets/ProgressWidget.cpp
ui/widgets/WideBar.h
ui/widgets/WideBar.cpp
+ ui/widgets/ThemeCustomizationWidget.h
+ ui/widgets/ThemeCustomizationWidget.cpp
# GUI - instance group view
ui/instanceview/InstanceProxyModel.cpp
@@ -939,6 +943,7 @@ SET(LAUNCHER_SOURCES
qt_wrap_ui(LAUNCHER_UI
ui/setupwizard/PasteWizardPage.ui
+ ui/setupwizard/ThemeWizardPage.ui
ui/pages/global/AccountListPage.ui
ui/pages/global/JavaPage.ui
ui/pages/global/LauncherPage.ui
@@ -971,6 +976,7 @@ qt_wrap_ui(LAUNCHER_UI
ui/widgets/CustomCommands.ui
ui/widgets/InfoFrame.ui
ui/widgets/ModFilterWidget.ui
+ ui/widgets/ThemeCustomizationWidget.ui
ui/dialogs/CopyInstanceDialog.ui
ui/dialogs/ProfileSetupDialog.ui
ui/dialogs/ProgressDialog.ui
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index e913849d..ab80fb80 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -111,6 +111,7 @@
#include "ui/dialogs/ExportInstanceDialog.h"
#include "ui/dialogs/ImportResourcePackDialog.h"
#include "ui/themes/ITheme.h"
+#include "ui/themes/ThemeManager.h"
#include <minecraft/mod/ResourcePackFolderModel.h>
#include <minecraft/mod/tasks/LocalResourcePackParseTask.h>
@@ -1346,7 +1347,7 @@ void MainWindow::updateThemeMenu()
themeAction->setActionGroup(themesGroup);
connect(themeAction, &QAction::triggered, [theme]() {
- APPLICATION->setApplicationTheme(theme->id(),false);
+ APPLICATION->setApplicationTheme(theme->id());
APPLICATION->settings()->set("ApplicationTheme", theme->id());
});
}
@@ -1652,32 +1653,9 @@ void MainWindow::onCatToggled(bool state)
APPLICATION->settings()->set("TheCat", state);
}
-namespace {
-template <typename T>
-T non_stupid_abs(T in)
-{
- if (in < 0)
- return -in;
- return in;
-}
-}
-
void MainWindow::setCatBackground(bool enabled)
{
- if (enabled)
- {
- QDateTime now = QDateTime::currentDateTime();
- QDateTime birthday(QDate(now.date().year(), 11, 30), QTime(0, 0));
- QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
- QDateTime halloween(QDate(now.date().year(), 10, 31), QTime(0, 0));
- QString cat = APPLICATION->settings()->get("BackgroundCat").toString();
- if (non_stupid_abs(now.daysTo(xmas)) <= 4) {
- cat += "-xmas";
- } else if (non_stupid_abs(now.daysTo(halloween)) <= 4) {
- cat += "-spooky";
- } else if (non_stupid_abs(now.daysTo(birthday)) <= 12) {
- cat += "-bday";
- }
+ if (enabled) {
view->setStyleSheet(QString(R"(
InstanceView
{
@@ -1688,10 +1666,8 @@ InstanceView
background-repeat: none;
background-color:palette(base);
})")
- .arg(cat));
- }
- else
- {
+ .arg(ThemeManager::getCatImage()));
+ } else {
view->setStyleSheet(QString());
}
}
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index bd7cec6a..69a8e3df 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -286,75 +286,6 @@ void LauncherPage::applySettings()
}
s->set("UpdateChannel", m_currentUpdateChannel);
- auto original = s->get("IconTheme").toString();
- //FIXME: make generic
- switch (ui->themeComboBox->currentIndex())
- {
- case 0:
- s->set("IconTheme", "pe_colored");
- break;
- case 1:
- s->set("IconTheme", "pe_light");
- break;
- case 2:
- s->set("IconTheme", "pe_dark");
- break;
- case 3:
- s->set("IconTheme", "pe_blue");
- break;
- case 4:
- s->set("IconTheme", "breeze_light");
- break;
- case 5:
- s->set("IconTheme", "breeze_dark");
- break;
- case 6:
- s->set("IconTheme", "OSX");
- break;
- case 7:
- s->set("IconTheme", "iOS");
- break;
- case 8:
- s->set("IconTheme", "flat");
- break;
- case 9:
- s->set("IconTheme", "flat_white");
- break;
- case 10:
- s->set("IconTheme", "multimc");
- break;
- case 11:
- s->set("IconTheme", "custom");
- break;
- }
-
- if(original != s->get("IconTheme"))
- {
- APPLICATION->setIconTheme(s->get("IconTheme").toString());
- }
-
- auto originalAppTheme = s->get("ApplicationTheme").toString();
- auto newAppTheme = ui->themeComboBoxColors->currentData().toString();
- if(originalAppTheme != newAppTheme)
- {
- s->set("ApplicationTheme", newAppTheme);
- APPLICATION->setApplicationTheme(newAppTheme, false);
- }
-
- switch (ui->themeBackgroundCat->currentIndex()) {
- case 0: // original cat
- s->set("BackgroundCat", "kitteh");
- break;
- case 1: // rory the cat
- s->set("BackgroundCat", "rory");
- break;
- case 2: // rory the cat flat edition
- s->set("BackgroundCat", "rory-flat");
- break;
- case 3: // teawie
- s->set("BackgroundCat", "teawie");
- break;
- }
s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked());
@@ -404,47 +335,6 @@ void LauncherPage::loadSettings()
}
m_currentUpdateChannel = s->get("UpdateChannel").toString();
- //FIXME: make generic
- auto theme = s->get("IconTheme").toString();
- QStringList iconThemeOptions{"pe_colored",
- "pe_light",
- "pe_dark",
- "pe_blue",
- "breeze_light",
- "breeze_dark",
- "OSX",
- "iOS",
- "flat",
- "flat_white",
- "multimc",
- "custom"};
- ui->themeComboBox->setCurrentIndex(iconThemeOptions.indexOf(theme));
-
- auto cat = s->get("BackgroundCat").toString();
- if (cat == "kitteh") {
- ui->themeBackgroundCat->setCurrentIndex(0);
- } else if (cat == "rory") {
- ui->themeBackgroundCat->setCurrentIndex(1);
- } else if (cat == "rory-flat") {
- ui->themeBackgroundCat->setCurrentIndex(2);
- } else if (cat == "teawie") {
- ui->themeBackgroundCat->setCurrentIndex(3);
- }
-
- {
- auto currentTheme = s->get("ApplicationTheme").toString();
- auto themes = APPLICATION->getValidApplicationThemes();
- int idx = 0;
- for(auto &theme: themes)
- {
- ui->themeComboBoxColors->addItem(theme->name(), theme->id());
- if(currentTheme == theme->id())
- {
- ui->themeComboBoxColors->setCurrentIndex(idx);
- }
- idx++;
- }
- }
// Toolbar/menu bar settings (not applicable if native menu bar is present)
ui->toolsBox->setEnabled(!QMenuBar().isNativeMenuBar());
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index ded333aa..65f4a9d5 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>514</width>
+ <width>511</width>
<height>629</height>
</rect>
</property>
@@ -38,7 +38,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>1</number>
</property>
<widget class="QWidget" name="featuresTab">
<attribute name="title">
@@ -243,155 +243,9 @@
<property name="title">
<string>Theme</string>
</property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>&amp;Icons</string>
- </property>
- <property name="buddy">
- <cstring>themeComboBox</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="themeComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
- </property>
- <item>
- <property name="text">
- <string>Simple (Colored Icons)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Simple (Light Icons)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Simple (Dark Icons)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Simple (Blue Icons)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Breeze Light</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Breeze Dark</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string notr="true">OSX</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string notr="true">iOS</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Flat</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Flat (White)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Legacy</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Custom</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>&amp;Colors</string>
- </property>
- <property name="buddy">
- <cstring>themeComboBoxColors</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="themeComboBoxColors">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>C&amp;at</string>
- </property>
- <property name="buddy">
- <cstring>themeBackgroundCat</cstring>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QComboBox" name="themeBackgroundCat">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy">
- <enum>Qt::StrongFocus</enum>
- </property>
- <item>
- <property name="text">
- <string>Background Cat (from MultiMC)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Rory ID 11 (drawn by Ashtaka)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Rory ID 11 (flat edition, drawn by Ashtaka)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Teawie (drawn by SympathyTea)</string>
- </property>
- </item>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="ThemeCustomizationWidget" name="themeCustomizationWidget" native="true"/>
</item>
</layout>
</widget>
@@ -575,6 +429,14 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>ThemeCustomizationWidget</class>
+ <extends>QWidget</extends>
+ <header>ui/widgets/ThemeCustomizationWidget.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>autoUpdateCheckBox</tabstop>
@@ -587,8 +449,6 @@
<tabstop>iconsDirBrowseBtn</tabstop>
<tabstop>sortLastLaunchedBtn</tabstop>
<tabstop>sortByNameBtn</tabstop>
- <tabstop>themeComboBox</tabstop>
- <tabstop>themeComboBoxColors</tabstop>
<tabstop>showConsoleCheck</tabstop>
<tabstop>autoCloseConsoleCheck</tabstop>
<tabstop>showConsoleErrorCheck</tabstop>
diff --git a/launcher/ui/setupwizard/SetupWizard.cpp b/launcher/ui/setupwizard/SetupWizard.cpp
index 3c8b5d39..3fd9bb23 100644
--- a/launcher/ui/setupwizard/SetupWizard.cpp
+++ b/launcher/ui/setupwizard/SetupWizard.cpp
@@ -13,7 +13,8 @@
SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent)
{
setObjectName(QStringLiteral("SetupWizard"));
- resize(615, 659);
+ resize(620, 660);
+ setMinimumSize(300, 400);
// make it ugly everywhere to avoid variability in theming
setWizardStyle(QWizard::ClassicStyle);
setOptions(QWizard::NoCancelButton | QWizard::IndependentPages | QWizard::HaveCustomButton1);
diff --git a/launcher/ui/setupwizard/ThemeWizardPage.cpp b/launcher/ui/setupwizard/ThemeWizardPage.cpp
new file mode 100644
index 00000000..42826aba
--- /dev/null
+++ b/launcher/ui/setupwizard/ThemeWizardPage.cpp
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-3.0-only
+/*
+ * Prism Launcher - Minecraft Launcher
+ * Copyright (C) 2022 Tayou <tayou@gmx.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#include "ThemeWizardPage.h"
+#include "ui_ThemeWizardPage.h"
+
+#include "Application.h"
+#include "ui/themes/ITheme.h"
+#include "ui/themes/ThemeManager.h"
+#include "ui/widgets/ThemeCustomizationWidget.h"
+#include "ui_ThemeCustomizationWidget.h"
+
+ThemeWizardPage::ThemeWizardPage(QWidget* parent) : BaseWizardPage(parent), ui(new Ui::ThemeWizardPage)
+{
+ ui->setupUi(this);
+
+ connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentIconThemeChanged, this, &ThemeWizardPage::updateIcons);
+ connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentCatChanged, this, &ThemeWizardPage::updateCat);
+
+ updateIcons();
+ updateCat();
+}
+
+ThemeWizardPage::~ThemeWizardPage()
+{
+ delete ui;
+}
+
+void ThemeWizardPage::updateIcons()
+{
+ qDebug() << "Setting Icons";
+ ui->previewIconButton0->setIcon(APPLICATION->getThemedIcon("new"));
+ ui->previewIconButton1->setIcon(APPLICATION->getThemedIcon("centralmods"));
+ ui->previewIconButton2->setIcon(APPLICATION->getThemedIcon("viewfolder"));
+ ui->previewIconButton3->setIcon(APPLICATION->getThemedIcon("launch"));
+ ui->previewIconButton4->setIcon(APPLICATION->getThemedIcon("copy"));
+ ui->previewIconButton5->setIcon(APPLICATION->getThemedIcon("export"));
+ ui->previewIconButton6->setIcon(APPLICATION->getThemedIcon("delete"));
+ ui->previewIconButton7->setIcon(APPLICATION->getThemedIcon("about"));
+ ui->previewIconButton8->setIcon(APPLICATION->getThemedIcon("settings"));
+ ui->previewIconButton9->setIcon(APPLICATION->getThemedIcon("cat"));
+ update();
+ repaint();
+ parentWidget()->update();
+}
+
+void ThemeWizardPage::updateCat()
+{
+ qDebug() << "Setting Cat";
+ ui->catImagePreviewButton->setIcon(QIcon(QString(R"(:/backgrounds/%1)").arg(ThemeManager::getCatImage())));
+}
+
+void ThemeWizardPage::retranslate()
+{
+ ui->retranslateUi(this);
+}
diff --git a/launcher/ui/setupwizard/ThemeWizardPage.h b/launcher/ui/setupwizard/ThemeWizardPage.h
new file mode 100644
index 00000000..61a3d0c0
--- /dev/null
+++ b/launcher/ui/setupwizard/ThemeWizardPage.h
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-3.0-only
+/*
+ * Prism Launcher - Minecraft Launcher
+ * Copyright (C) 2022 Tayou <tayou@gmx.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include <QWidget>
+#include "BaseWizardPage.h"
+
+namespace Ui {
+class ThemeWizardPage;
+}
+
+class ThemeWizardPage : public BaseWizardPage {
+ Q_OBJECT
+
+ public:
+ explicit ThemeWizardPage(QWidget* parent = nullptr);
+ ~ThemeWizardPage();
+
+ bool validatePage() override { return true; };
+ void retranslate() override;
+
+ private slots:
+ void updateIcons();
+ void updateCat();
+
+ private:
+ Ui::ThemeWizardPage* ui;
+};
diff --git a/launcher/ui/setupwizard/ThemeWizardPage.ui b/launcher/ui/setupwizard/ThemeWizardPage.ui
new file mode 100644
index 00000000..01394ea4
--- /dev/null
+++ b/launcher/ui/setupwizard/ThemeWizardPage.ui
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ThemeWizardPage</class>
+ <widget class="QWizardPage" name="ThemeWizardPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>510</width>
+ <height>552</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>WizardPage</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Select the Theme you wish to use</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="ThemeCustomizationWidget" name="themeCustomizationWidget" native="true">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>100</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Hint: The cat appears in the background and is not shown by default. It is only made visible when pressing the Cat button in the Toolbar.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string> Preview:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QGridLayout" name="iconPreview">
+ <item row="0" column="2">
+ <widget class="QPushButton" name="previewIconButton2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="icon">
+ <iconset theme="applications-engineering">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="QPushButton" name="previewIconButton5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="icon">
+ <iconset theme="applications-engineering">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="7">
+ <widget class="QPushButton" name="previewIconButton7">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="icon">
+ <iconset theme="applications-engineering">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QPushButton" name="previewIconButton4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>