aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp110
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui166
2 files changed, 13 insertions, 263 deletions
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>