Programmatic color scheme change in QKdeTheme
Axel Spoerl
axel.spoerl at qt.io
Tue Mar 11 10:46:17 GMT 2025
Just thinking out loud:
How about adding an
extern "C" MAYBE_SOME_EXPORT QGenericUnixTheme *createTheme() { return new KdePlatformtheme(); }
to KdePlatformTheme?
We could then try to load the KDE library at runtine in QKdeTheme::createKdeTheme(). If we can resolve the symbol, an application that doesn't even know from KDE could benefit from KdePlatformTheme.
...and while at it, requestColorScheme() could also be re-implemented....
________________________________
From: kde-devel <kde-devel-bounces at kde.org> on behalf of David Redondo <kde at david-redondo.de>
Sent: Tuesday, 11 March 2025 10:37
To: kde-devel at kde.org <kde-devel at kde.org>
Subject: Re: Re: Re: Programmatic color scheme change in QKdeTheme
[You don't often get email from kde at david-redondo.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Am Dienstag, 11. März 2025, 10:10 schrieb Axel Spoerl:
> Hi David,
> thanks for the insight!
> The program would be ideal. However, it depends on KDE libraries. If an
application links to KDE anyway, it can simply use the KDE platform theme.
> Users of QKdeTheme are e.g. applications that don't link to KDE, because
they need to run on Gnome environments as well.
> If we wanted to propagate palettes to QKdeTheme, we would have to read them
directly from settings without having to link to KDE.
> Cheers
> Axel
Heh I did not expect that Qt would start to link KColorScheme library :D. But
the output could be used to make default palettes for QKDETheme.
Another option would be to just read the files during runtime. I see that
QKdeThemePrivate::readKdeSystemPalette already can read colors from
.config/kdeglobals which contain the colors of the currently active color
scheme. The color scheme files in $GenericDataLocation/color-schemes/
have the same format.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20250311/15c96f9d/attachment.htm>
More information about the kde-devel
mailing list