summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Kyle K2022-04-10 14:04:50 -0700
committerGravatar Kyle K2022-04-11 00:00:29 -0700
commit38dd6dc190313e507db21f6aaeda90b94e9b9768 (patch)
tree935238aaed3459b0f642113cd7c8a77cdf182d28 /src
parentMerge pull request #8149 from liamwhite/front-face (diff)
downloadyuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.gz
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.tar.xz
yuzu-38dd6dc190313e507db21f6aaeda90b94e9b9768.zip
ui: Set Link Color when setting theme
Long story short, QT doesn't allow the link colors to be set via their stylesheets. There are two ways to work with this, specify the color manually for every link (See the About dialog) The other way is to change the default palette. IsDarkTheme is copy/pasted from src/yuzu/debugger/wait_tree.cpp
Diffstat (limited to 'src')
-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() {
3652 setStyleSheet({}); 3652 setStyleSheet({});
3653 } 3653 }
3654 3654
3655 QPalette new_pal(qApp->palette());
3656 if (UISettings::IsDarkTheme()) {
3657 new_pal.setColor(QPalette::Text, QColor(255, 255, 255, 255));
3658 new_pal.setColor(QPalette::Link, QColor(0, 190, 255, 255));
3659 } else {
3660 new_pal.setColor(QPalette::Text, QColor(0, 0, 0, 255));
3661 new_pal.setColor(QPalette::Link, QColor(0, 140, 200, 255));
3662 }
3663 qApp->setPalette(new_pal);
3664
3655 QIcon::setThemeName(current_theme); 3665 QIcon::setThemeName(current_theme);
3656 QIcon::setThemeSearchPaths(theme_paths); 3666 QIcon::setThemeSearchPaths(theme_paths);
3657} 3667}
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{{
15 {"Midnight Blue Colorful", "colorful_midnight_blue"}, 15 {"Midnight Blue Colorful", "colorful_midnight_blue"},
16}}; 16}};
17 17
18bool IsDarkTheme() {
19 const auto& theme = UISettings::values.theme;
20 return theme == QStringLiteral("qdarkstyle") ||
21 theme == QStringLiteral("qdarkstyle_midnight_blue") ||
22 theme == QStringLiteral("colorful_dark") ||
23 theme == QStringLiteral("colorful_midnight_blue");
24}
25
18Values values = {}; 26Values values = {};
19 27
20} // namespace UISettings 28} // 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 @@
17 17
18namespace UISettings { 18namespace UISettings {
19 19
20bool IsDarkTheme();
21
20struct ContextualShortcut { 22struct ContextualShortcut {
21 QString keyseq; 23 QString keyseq;
22 QString controller_keyseq; 24 QString controller_keyseq;