From 99e1c13e80d12764f57a993661656d9ed7de27bb Mon Sep 17 00:00:00 2001
From: he3als <65787561+he3als@users.noreply.github.com>
Date: Sat, 22 Oct 2022 15:50:06 +0100
Subject: [PATCH] fix: add flat_white to code
---
launcher/CMakeLists.txt | 1 +
launcher/main.cpp | 1 +
launcher/resources/flat_white/index.theme | 2 +-
launcher/ui/pages/global/LauncherPage.cpp | 13 ++++++++++---
launcher/ui/pages/global/LauncherPage.ui | 5 +++++
5 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index 79ac49c7..0dae47df 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -602,6 +602,7 @@ SET(LAUNCHER_SOURCES
resources/OSX/OSX.qrc
resources/iOS/iOS.qrc
resources/flat/flat.qrc
+ resources/flat_white/flat_white.qrc
resources/documents/documents.qrc
../${Launcher_Branding_LogoQRC}
diff --git a/launcher/main.cpp b/launcher/main.cpp
index c6a7614c..e2116f38 100644
--- a/launcher/main.cpp
+++ b/launcher/main.cpp
@@ -84,6 +84,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(OSX);
Q_INIT_RESOURCE(iOS);
Q_INIT_RESOURCE(flat);
+ Q_INIT_RESOURCE(flat_white);
return app.exec();
}
case Application::Failed:
diff --git a/launcher/resources/flat_white/index.theme b/launcher/resources/flat_white/index.theme
index a0b3ba6f..0292509f 100644
--- a/launcher/resources/flat_white/index.theme
+++ b/launcher/resources/flat_white/index.theme
@@ -1,5 +1,5 @@
[Icon Theme]
-Name=White Flat
+Name=Flat (White)
Comment=White version of the flat icons (for dark mode)
Inherits=multimc
Directories=scalable
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index b8431e8c..536ab22e 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -310,9 +310,12 @@ void LauncherPage::applySettings()
s->set("IconTheme", "flat");
break;
case 7:
- s->set("IconTheme", "multimc");
+ s->set("IconTheme", "flat_white");
break;
case 8:
+ s->set("IconTheme", "multimc");
+ break;
+ case 9:
s->set("IconTheme", "custom");
break;
}
@@ -408,14 +411,18 @@ void LauncherPage::loadSettings()
{
ui->themeComboBox->setCurrentIndex(6);
}
- else if (theme == "multimc")
+ else if (theme == "flat_white")
{
ui->themeComboBox->setCurrentIndex(7);
}
- else if (theme == "custom")
+ else if (theme == "multimc")
{
ui->themeComboBox->setCurrentIndex(8);
}
+ else if (theme == "custom")
+ {
+ ui->themeComboBox->setCurrentIndex(9);
+ }
{
auto currentTheme = s->get("ApplicationTheme").toString();
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index 0d14f147..76a25f2e 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -300,6 +300,11 @@
Flat
+ -
+
+ Flat (White)
+
+
-
Legacy