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

style: Add options for system colors and system Qt widget styles #1828

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from

Conversation

tomboylover93
Copy link
Contributor

Taken from https://github.com/tomboylover93/shadPS4/releases/tag/v0.4.1_WIP_qt-style:

  • Added "System (Light)" and "System (Dark)" options under View -> Themes. Since I couldn't figure out how to apply different icon colors based on whether or not your system theme is light or dark, they are separate options, so you should use them according to your system colors. Tested on Linux with KDE Plasma. Untested on Windows and macOS, but might be useful on Windows if you use custom system themes.
  • Added "Widget Style" options on the Settings menu, with text that shows up on mouse hover. Defaults to "Fusion", as it is currently hardcoded to do so. "System" uses your system's default Qt widget style (example: Breeze, Oxygen, MS Windows 9x, Kvantum). Linux users can override this with the QT_STYLE_OVERRIDE environment variable, as long as it's set to "System". You can tweak this on config.toml with the line widgetStyle = "Fusion". Since I couldn't figure out how to repaint all widgets after clicking on either "Save" or "Apply", this doesn't reflect in real time and you need to close and reopen shadPS4. Tested on Linux with KDE Plasma. Untested on Windows and macOS.

Screenshots (taken on Linux with KDE Plasma):

  • "System (Dark)" color theme, "Fusion" widget style

Screenshot_20241219_114710

  • "System (Light)" color theme, "Fusion" widget style

Screenshot_20241219_114840

  • "Dark" color theme, "System" widget style (set to Breeze in KDE System Settings)

Screenshot_20241219_115140

  • "System (Dark)" color theme, "System" widget style (set to Bali10050/Lightly in KDE System Settings)

Screenshot_20241219_115317

Additional screenshots

  • Settings menu

Screenshot_20241219_132609

This is purely cosmetical and should not affect the usability of the emulator in any way, but if you do have issues with it, such as the emulator not launching or the color/widget style changes not working, please let me know.

Widget repainting isn't implemented yet, it's necessary to close and reopen shadPS4 after changing widget style
@rainmakerv3
Copy link
Contributor

For checking system dark mode, you can try

if QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark

for refreshing widgets after a save/apply, i think you can have update->widget every widget and then QCoreApplication::processEvents after clicking apply/save (or if i remember right i put the same function for both, if so that would work better).

also i still think the widget style selection is better placed over/under where the theme selection is

@tomboylover93
Copy link
Contributor Author

I tried both of these. The first one broke all themes and their icon colors and the second has no effect. Unless I missed something?

As for placing the widget style selection on the View menu, I tried that before I decided to make a group box in the settings menu for it, and the emulator segfaulted immediately, so I went with the latter.

@rainmakerv3
Copy link
Contributor

The issue is the combination of system widgets with themes that enforce conflicting text colors. you can see it in the video I have above

@tomboylover93
Copy link
Contributor Author

To my knowledge, the Gruvbox theme is the only one that enforces a specific text color, every other theme uses themePalette.setColor(QPalette::ButtonText, Qt::white);. I'll try changing that to see if this issue stops happening.

@rainmakerv3
Copy link
Contributor

That would be forcing the text to white yes, most of the themes are darker background

@tomboylover93
Copy link
Contributor Author

Pushed it to my qt-style-test branch. Can someone try this action?

@GHU7924
Copy link

GHU7924 commented Dec 22, 2024

@tomboylover93 The problem is that if the system theme is selected in GUI Settings, then everything breaks. That's where the problem lies. This is where the distortion occurs due to the color mismatch. With Fusion, all 7 themes seem to be working fine.
Or at least I didn't notice any obvious problems if we are launching the emulator for the first time.

The fact is that Windows has always had a light theme.
Then at one point they added a dark one, which I wrote about above, this setting affects the explorer.
Now you can make it dark.

I see a possible solution in the following:
You just need to make sure that when you select a system theme in the GUI settings,
the system theme (View - Themes) was also selected by default,
and selecting other themes from this list would be prohibited.

It seems that if you select a system theme in the GUI settings, and then select one of the themes (View - Themes), then switch to Fusion and (View - Themes) select a light theme, then distortion also occurs.
4

@GHU7924
Copy link

GHU7924 commented Dec 22, 2024

Поместил его в свою ветку qt-style-test . Может кто-нибудь попробовать это действие?

GUI Settings - Current Widget Style = System
View - Themes = Light
OS color mode = Dark

5

GUI Settings - Current Widget Style = System
View - Themes = Dark
OS color mode = Light

6

@tomboylover93
Copy link
Contributor Author

Just to check, does it work as intended if the widget and theme are set to System and with the Windows color mode set to either dark or light?

@GHU7924
Copy link

GHU7924 commented Dec 23, 2024

10

@tomboylover93
Copy link
Contributor Author

This is a strange case. Either I combine the System color theme and widget style into one (which I haven't figured out how to) or I grey out the System option on Windows, which neither is ideal, but the latter is better than the former as it is currently hardcoded to use Fusion because most of the UI was built around it, and Windows has the largest userbase out of all the 3 OSes supported by shadPS4.

Besides that, I also need to know how this works in macOS.

@GHU7924
Copy link

GHU7924 commented Dec 23, 2024

I think that somehow you need to remove the "Not OK" option, leaving only both options OK.

@tomboylover93
Copy link
Contributor Author

I'd have to remove every theme other than System, which means this probably won't get merged. Unless I reworked the theme system to use the Fusion widget for other color themes, like what PCSX2 and Duckstation do.

@GHU7924
Copy link

GHU7924 commented Dec 23, 2024

@tomboylover93 Look at PR 1855, something similar was done there. Yes, PR is completely different, (but if there are items in the menu, you cannot select them, because there is no checkbox in the checkbox). Maybe this can be somehow transferred to the Current Widget Style selection.
Something like, when the system theme is selected, you will not be able to select other themes other than the system theme.

@tomboylover93
Copy link
Contributor Author

Seems like a good alternative, I'll look into it.

@GHU7924
Copy link

GHU7924 commented Dec 26, 2024

Besides that, I also need to know how this works in macOS.

@C4ndyF1sh , you can help @tomboylover93 test this PR on MacOS?

@C4ndyF1sh
Copy link

@GHU7924
Works on Mac Screenshot 2024-12-27 at 16 56 19

@C4ndyF1sh
Copy link

C4ndyF1sh commented Dec 27, 2024

@GHU7924 I switched to light mode but shadps4 doesn't, I even restarted shad (Tried with system theme on and off) Screenshot 2024-12-27 at 16 59 20

@GHU7924
Copy link

GHU7924 commented Dec 27, 2024

@C4ndyF1sh In General, try Current Widget Style = System.

You can see our comments above and compare them with your experience to see if you have similar problems.

Thank you for responding.

P.S. I haven't tested the new build yet, I'll do a test in the near future.

@GHU7924
Copy link

GHU7924 commented Dec 27, 2024

@tomboylover93 Perhaps it would be better to replace the style selection with Radio buttons?
0

Fusion - all themes are available.
System = System + System and click blocking "Themes".

@tomboylover93
Copy link
Contributor Author

I could do that but I don't know how to combine both Qt themes and color themes, nor how to block "Themes" from being clicked when selecting System.

@GHU7924
Copy link

GHU7924 commented Dec 27, 2024

@tomboylover93 Then you should mark your PR as a draft.

Perhaps @f8ith or @DanielSvoboda they will give you some tips, or maybe not.
(The description of the problem begins with comments from about 5-7 days ago to today).

@tomboylover93 tomboylover93 marked this pull request as draft December 27, 2024 20:50
@tomboylover93
Copy link
Contributor Author

I switched to light mode but shadps4 doesn't

@C4ndyF1sh Can you try the latest commit?

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

Successfully merging this pull request may close these issues.

4 participants