Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DolphinQt: Allow forcing light or dark style on Windows. #12272

Merged
merged 4 commits into from Nov 5, 2023

Conversation

AdmiralCurtiss
Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss commented Nov 4, 2023

This has been requested a few times since the introduction of the Windows dark style. #12180 also attempted to do this but it seemingly stalled out.

Windows-only for now. I'd have to investigate if there's a way to override the system style when it's automatically managed by Qt for the other OSes.


UI-wise, this reuses the User Style dropdown to now also switch between System, Light, and Dark. (On OSes other than Windows Light and Dark will not be in the dropdown.) The checkbox to enable user styles has been removed, the dropdown is now always visible and shows both our builtin and the user styles.

Before:
ui-before

After:
ui-after

@MayImilae
Copy link
Contributor

MayImilae commented Nov 4, 2023

LGTM. (untested)

Copy link
Member

@dreamsyntax dreamsyntax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Windows 10. Works as expected.
Is there a reason the parenthesis are included? ( ) is this just to differentiate Dolphin bundled Style vs User Style*?

@AdmiralCurtiss
Copy link
Contributor Author

Yes, that was my intent, but if someone has a better idea how to differentiate them I'm all ears.

This makes it so that if you just want to reload the current style (eg. on program start, or in response to a system event), you don't need to know the name of the currently selected user style. It's also more consistent with the way the 'userstyle/enabled' flag works.
@mbc07
Copy link
Contributor

mbc07 commented Nov 5, 2023

The UI looks perfect to me.

One nitpick, though, the title bars don't seem to follow a forced dark mode, e.g. forcing dark mode while Windows is in light mode will render light title bars (forcing light mode while Windows is in dark mode will correctly apply light title bars, though). Could you fix that, so a forced dark mode render dark title bars, regardless of the Windows setting?

It would be nice if this could be extended to the other desktop OSes we support at some point...

@AdmiralCurtiss
Copy link
Contributor Author

Better now? You may have to restart Dolphin after changing the theme to get the correct result for the title bars.

@AdmiralCurtiss AdmiralCurtiss merged commit 1748e64 into dolphin-emu:master Nov 5, 2023
11 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the dark-mode-gui branch November 5, 2023 17:31
@ewancg
Copy link

ewancg commented Nov 5, 2023

I got stuck looking for a way to do this in macOS. I'm not well versed in Objective C APIs. Good on you for getting this done 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants