Fix icons changing when exiting the settings window

This commit is contained in:
Joshua Goins 2022-01-27 18:37:57 -05:00
parent 33aac2985a
commit 5ac528f141
2 changed files with 26 additions and 27 deletions

View File

@ -246,33 +246,32 @@ void LauncherPage::applySettings()
//FIXME: make generic //FIXME: make generic
switch (ui->themeComboBox->currentIndex()) switch (ui->themeComboBox->currentIndex())
{ {
case 1: case 0:
s->set("IconTheme", "pe_dark"); s->set("IconTheme", "pe_dark");
break; break;
case 2: case 1:
s->set("IconTheme", "pe_light"); s->set("IconTheme", "pe_light");
break; break;
case 3: case 2:
s->set("IconTheme", "pe_blue"); s->set("IconTheme", "pe_blue");
break; break;
case 4: case 3:
s->set("IconTheme", "multimc"); s->set("IconTheme", "pe_colored");
break; break;
case 5: case 4:
s->set("IconTheme", "OSX"); s->set("IconTheme", "OSX");
break; break;
case 6: case 5:
s->set("IconTheme", "iOS"); s->set("IconTheme", "iOS");
break; break;
case 7: case 6:
s->set("IconTheme", "flat"); s->set("IconTheme", "flat");
break; break;
case 8: case 7:
s->set("IconTheme", "custom"); s->set("IconTheme", "custom");
break; break;
case 0: case 8:
default: s->set("IconTheme", "multimc");
s->set("IconTheme", "pe_colored");
break; break;
} }
@ -327,29 +326,33 @@ void LauncherPage::loadSettings()
auto theme = s->get("IconTheme").toString(); auto theme = s->get("IconTheme").toString();
if (theme == "pe_dark") if (theme == "pe_dark")
{ {
ui->themeComboBox->setCurrentIndex(1); ui->themeComboBox->setCurrentIndex(0);
} }
else if (theme == "pe_light") else if (theme == "pe_light")
{ {
ui->themeComboBox->setCurrentIndex(2); ui->themeComboBox->setCurrentIndex(1);
} }
else if (theme == "pe_blue") else if (theme == "pe_blue")
{ {
ui->themeComboBox->setCurrentIndex(3); ui->themeComboBox->setCurrentIndex(2);
} }
else if (theme == "pe_colored") else if (theme == "pe_colored")
{ {
ui->themeComboBox->setCurrentIndex(4); ui->themeComboBox->setCurrentIndex(3);
} }
else if (theme == "OSX") else if (theme == "OSX")
{ {
ui->themeComboBox->setCurrentIndex(5); ui->themeComboBox->setCurrentIndex(4);
} }
else if (theme == "iOS") else if (theme == "iOS")
{ {
ui->themeComboBox->setCurrentIndex(6); ui->themeComboBox->setCurrentIndex(5);
} }
else if (theme == "flat") else if (theme == "flat")
{
ui->themeComboBox->setCurrentIndex(6);
}
else if (theme == "multimc")
{ {
ui->themeComboBox->setCurrentIndex(7); ui->themeComboBox->setCurrentIndex(7);
} }
@ -357,10 +360,6 @@ void LauncherPage::loadSettings()
{ {
ui->themeComboBox->setCurrentIndex(8); ui->themeComboBox->setCurrentIndex(8);
} }
else
{
ui->themeComboBox->setCurrentIndex(0);
}
{ {
auto currentTheme = s->get("ApplicationTheme").toString(); auto currentTheme = s->get("ApplicationTheme").toString();

View File

@ -262,11 +262,6 @@
<property name="focusPolicy"> <property name="focusPolicy">
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Simple (Dark Icons)</string> <string>Simple (Dark Icons)</string>
@ -307,6 +302,11 @@
<string>Custom</string> <string>Custom</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>MultiMC</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">