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

Apply new platform palette without overriding app palette #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jlindgren90
Copy link
Contributor

Currently when a palette is set by qt6ct, it can in some cases override an app-specific palette. It would be nice if qt6ct would only set the platform palette (i.e. QPlatformTheme::SystemPalette) and still allow apps to set/adjust their own palette when desired.

Test case: start Audacious and select Dark theme in Audacious settings. Then in qt6ct configuration, select "dusk" or "sand" color scheme. It partially applies to Audacious (where it should not) and you end up with an unusable mix of Audacious's color scheme and qt6ct's.

Port of the qt5ct patch from https://sourceforge.net/p/qt5ct/tickets/97/. I have been using the patch in both qt5ct and qt6ct for quite some time and have not seen any ill side effects.

Currently when a palette is set by qt6ct, it can in some cases override
an app-specific palette. It would be nice if qt6ct would only set the
platform palette (i.e. QPlatformTheme::SystemPalette) and still allow
apps to set/adjust their own palette when desired.

Test case: start Audacious and select Dark theme in Audacious settings.
Then in qt6ct configuration, select "dusk" or "sand" color scheme. It
partially applies to Audacious (where it should not) and you end up with
an unusable mix of Audacious's color scheme and qt6ct's.

Port of the qt5ct patch from https://sourceforge.net/p/qt5ct/tickets/97/.
I have been using the patch in both qt5ct and qt6ct for quite some time
and have not seen any ill side effects.
@jlindgren90 jlindgren90 changed the title Apply new platform palette without overriding app paletee Apply new platform palette without overriding app palette May 11, 2024
jlindgren90 added a commit to jlindgren90/qt6ct that referenced this pull request May 11, 2024
Currently when a palette is set by qt6ct, it can in some cases override
an app-specific palette. It would be nice if qt6ct would only set the
platform palette (i.e. QPlatformTheme::SystemPalette) and still allow
apps to set/adjust their own palette when desired.

Test case: start Audacious and select Dark theme in Audacious settings.
Then in qt6ct configuration, select "dusk" or "sand" color scheme. It
partially applies to Audacious (where it should not) and you end up with
an unusable mix of Audacious's color scheme and qt6ct's.

Port of the qt5ct patch from https://sourceforge.net/p/qt5ct/tickets/97/.
I have been using the patch in both qt5ct and qt6ct for quite some time
and have not seen any ill side effects.

trialuser02#48
@ilya-fedin
Copy link

It might be a good idea to port qt6ct to QWindowSystemInterface::handleThemeChange which updates system dark mode state (which Qt calls color scheme), palette, icons and fonts without overriding them via APIs meant for applications: https://github.com/qt/qtbase/blob/dev/src/gui/kernel/qguiapplication.cpp#L2639-L2669

@ilya-fedin
Copy link

It might be a good idea to port qt6ct to QWindowSystemInterface::handleThemeChange

Implemented with #52

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.

2 participants