diff options
| author | 2022-04-13 22:15:31 -0700 | |
|---|---|---|
| committer | 2022-04-13 22:15:31 -0700 | |
| commit | 8ae43a1be96c8673a182c2cf92bea4f1c5888adb (patch) | |
| tree | 9292316010f234bb492fcec47fcfd104e882be5f /src | |
| parent | Merge pull request #8027 from lat9nq/cmd-fullscreen-size (diff) | |
| parent | ui: Touching QPalette::Text broke dark -> light UI. don't do (diff) | |
| download | yuzu-8ae43a1be96c8673a182c2cf92bea4f1c5888adb.tar.gz yuzu-8ae43a1be96c8673a182c2cf92bea4f1c5888adb.tar.xz yuzu-8ae43a1be96c8673a182c2cf92bea4f1c5888adb.zip | |
Merge pull request #8190 from Docteh/palswap
ui: Set Link Color when setting theme
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/uisettings.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 62d15f8cd..52879a989 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -3652,6 +3652,14 @@ 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::Link, QColor(0, 190, 255, 255)); | ||
| 3658 | } else { | ||
| 3659 | new_pal.setColor(QPalette::Link, QColor(0, 140, 200, 255)); | ||
| 3660 | } | ||
| 3661 | qApp->setPalette(new_pal); | ||
| 3662 | |||
| 3655 | QIcon::setThemeName(current_theme); | 3663 | QIcon::setThemeName(current_theme); |
| 3656 | QIcon::setThemeSearchPaths(theme_paths); | 3664 | QIcon::setThemeSearchPaths(theme_paths); |
| 3657 | } | 3665 | } |
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 | ||
| 18 | bool 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 | |||
| 18 | Values values = {}; | 26 | Values 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 | ||
| 18 | namespace UISettings { | 18 | namespace UISettings { |
| 19 | 19 | ||
| 20 | bool IsDarkTheme(); | ||
| 21 | |||
| 20 | struct ContextualShortcut { | 22 | struct ContextualShortcut { |
| 21 | QString keyseq; | 23 | QString keyseq; |
| 22 | QString controller_keyseq; | 24 | QString controller_keyseq; |