1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-09-01 08:56:32 -05:00

Add dark mode configuration setting in UI tab

- Allows to choose "Auto", "Always On" or "Always Off"
  - Dark mode options are only shown if the style does not support theme
- If Auto is chosen, value is retrieved from OS
  - On Windows, the application needs a restart to apply the settings
- Use the default dark palette for Windows, like on Linux
This commit is contained in:
flodavid
2024-02-12 04:01:25 +01:00
parent 9bba778d15
commit 7c9545c82a
10 changed files with 221 additions and 74 deletions

View File

@@ -67,6 +67,7 @@ SWITCHABLE(u8, true);
// Used in UISettings
// TODO see if we can move this to uisettings.cpp
SWITCHABLE(ConfirmStop, true);
SWITCHABLE(DarkModeState, true);
#undef SETTING
#undef SWITCHABLE

View File

@@ -90,6 +90,7 @@ SWITCHABLE(u8, true);
// Used in UISettings
// TODO see if we can move this to uisettings.h
SWITCHABLE(ConfirmStop, true);
SWITCHABLE(DarkModeState, true);
#undef SETTING
#undef SWITCHABLE

View File

@@ -155,6 +155,8 @@ ENUM(ConsoleMode, Handheld, Docked);
ENUM(AppletMode, HLE, LLE);
ENUM(DarkModeState, Off, On, Auto);
template <typename Type>
inline std::string CanonicalizeEnum(Type id) {
const auto group = EnumMetadata<Type>::Canonicalizations();