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

Use system theme on linux. #2309

Open
aitet opened this issue Dec 23, 2020 · 2 comments
Open

Use system theme on linux. #2309

aitet opened this issue Dec 23, 2020 · 2 comments

Comments

@aitet
Copy link

aitet commented Dec 23, 2020

Above is my system theme ("Materia Dark") and bellow is the default Fusion theme.
image

The fusion theme looks old and dated. It makes the whole application not integrated like the other qt applications on my system. Fusion looks dated and the solution that is used from stackoverflow is almost 8 years old.

I commented out these two lines and got no errors.
QApplication::setStyle(QStyleFactory::create("Fusion")); installCustomPalette();

Of course you are doing this because you want a dark theme on windows, but please make a check if the system is linux and have it use the system theme.

@fourtf
Copy link
Member

fourtf commented Dec 25, 2020

The settings ui is designed for darkmode only. So changing this to system theme requires adjusting the theme for light mode. Maybe there is a non-hacky way to check if the OS theme is dark?

@aitet
Copy link
Author

aitet commented Dec 26, 2020

Here is the application with a light theme ("Materia")
image

It's not unusable, but definitely needs work if implemented.
The reason the light-themes does not work is that ui color should have not been defined outside the installCustomPalette colors. The text that uses the dark.setColor(QPalette::Text, Qt::white); switches color to black when a light theme is used. Text that used a custom color stayed white when they should have not.
So i don't think there needs to be a check if a light mode is used.

Now this is a lot of effort to basically rewrite a lot of the ui. And only a small set of users that compile the program for themselves (there is no linux binary), gets any benefit.
I do recommend to start using or changing the QPalette colors instead of defining custom colors, will make it easier to move to a newer version of qt or update form the fusion theme.

@Nerixyz Nerixyz mentioned this issue Aug 20, 2024
4 tasks
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

No branches or pull requests

2 participants