summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <190571+Docteh@users.noreply.github.com>2022-04-10 23:04:50 +0200
committerKyle K <190571+Docteh@users.noreply.github.com>2022-04-11 09:00:29 +0200
commit38dd6dc190313e507db21f6aaeda90b94e9b9768 (patch)
tree935238aaed3459b0f642113cd7c8a77cdf182d28
parentMerge pull request #8149 from liamwhite/front-face (diff)
downloadyuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.gz
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.bz2
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.lz
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.xz
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.zst
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.zip
-rw-r--r--src/yuzu/main.cpp10
-rw-r--r--src/yuzu/uisettings.cpp8
-rw-r--r--src/yuzu/uisettings.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 62d15f8cd..d1be08edb 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -3652,6 +3652,16 @@ void GMainWindow::UpdateUITheme() {
setStyleSheet({});
}
+ QPalette new_pal(qApp->palette());
+ if (UISettings::IsDarkTheme()) {
+ new_pal.setColor(QPalette::Text, QColor(255, 255, 255, 255));
+ new_pal.setColor(QPalette::Link, QColor(0, 190, 255, 255));
+ } else {
+ new_pal.setColor(QPalette::Text, QColor(0, 0, 0, 255));
+ new_pal.setColor(QPalette::Link, QColor(0, 140, 200, 255));
+ }
+ qApp->setPalette(new_pal);
+
QIcon::setThemeName(current_theme);
QIcon::setThemeSearchPaths(theme_paths);
}
diff --git a/src/yuzu/uisettings.cpp b/src/yuzu/uisettings.cpp
index 21683576c..f683b80f7 100644
--- a/src/yuzu/uisettings.cpp
+++ b/src/yuzu/uisettings.cpp
@@ -15,6 +15,14 @@ const Themes themes{{
{"Midnight Blue Colorful", "colorful_midnight_blue"},
}};
+bool IsDarkTheme() {
+ const auto& theme = UISettings::values.theme;
+ return theme == QStringLiteral("qdarkstyle") ||
+ theme == QStringLiteral("qdarkstyle_midnight_blue") ||
+ theme == QStringLiteral("colorful_dark") ||
+ theme == QStringLiteral("colorful_midnight_blue");
+}
+
Values values = {};
} // namespace UISettings
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index cc5aee382..15ba9ea17 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -17,6 +17,8 @@
namespace UISettings {
+bool IsDarkTheme();
+
struct ContextualShortcut {
QString keyseq;
QString controller_keyseq;