-
Notifications
You must be signed in to change notification settings - Fork 167
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
Use Windows settings to determine titlebar color #1933
Conversation
Turns out this only applies to the main window but not any other QWidget window. I'll have to see if there's an efficient way to apply this to all windows. |
You probably should use Qt for this, I think you can set a palette for the title bar, see e.g. https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5 |
- Fusion already implements light/dark mode switching, the original 'windowsvista' style does not - Applying the stylesheet on top of Fusion colors the titlebar based on the OS setting
Turns out the 'fusion' style is what already implements titlebar color changing based on OS settings. Just setting that as the 'base' application theme does what we want. |
This sets fusion as the default style for MO2, so that's probably not what we want. It works if you have another theme selected that overrides basically everything, but not if you use the default Qt theme. |
The difference is fusion is the default style instead of the windowsvista style. They are both core qt styles but only fusion supports automatic dark/light mode switching including the titlebar. As far as I can tell this is the only way to support it barring extending our own base style which reimplements the fusion titlebar code. Fusion is designed to be their modern theme which utilizes the more modern OS style features. |
The windowsvista style is Windows-like and has been the default one probably forever. Changing it to
That's probably what we should do, but the bigger issue is that you cannot link the stylesheet to the color theme, so you can end-up with a dark theme (e.g. VS Dark), with a light title bar is user has a light color theme in Windows. |
Dolphin Emulator decided that Fusion was a big enough change that they bit the bullet and manually implemented dark mode on top of QWindowsVistaStyle. It's discussed on their blog: https://dolphin-emu.org/blog/2023/11/25/dolphin-progress-report-august-september-and-october-2023/ |
I actually have tried the existing styles with this change and the visible differences are fairly slight since most of these themes do actually touch most of the UI. In fact, it seems the issue with the weird selection box coloring is fixed, although a couple of selection boxes are now light colored even with dark themes. (The instance creation options.) Though I still find this preferable to the weird buggy text coloring in 2.5.0. Now, it's true that the titlebar will use the windows light/dark setting regardless of what theme is selected but having it not do that while supporting a dark titlebar when appropriate means we're going to have to add a way to indicate if a stylesheet is light or not and tell the custom Qt style which mode to use. All that being said, I don't think themes would need much updating and several of the primary theme authors are still pretty active. So I don't see why we can't just update the existing styles for fusion. At that point it's really just 'oh no, i have a light theme selected but dark mode set in Windows and my titlebar is dark'. Which seems like a fairly minor problem. (At least, no worse and probably slightly better than what we have right now.) |
This is likely obsolete with the latest Qt changes |
It would be good to test this on Windows 10.