<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi David,<br>
thanks for the insight!<br>
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.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Users of QKdeTheme are e.g. applications that don't link to KDE, because they need to run on Gnome environments as well.<br>
If we wanted to propagate palettes to QKdeTheme, we would have to read them directly from settings without having to link to KDE.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers<br>
Axel</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> David Redondo <david@david-redondo.de><br>
<b>Sent:</b> Tuesday, 11 March 2025 09:39<br>
<b>To:</b> kde-devel@kde.org <kde-devel@kde.org><br>
<b>Cc:</b> Axel Spoerl <axel.spoerl@qt.io><br>
<b>Subject:</b> Re: Re: Programmatic color scheme change in QKdeTheme</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[You don't often get email from david@david-redondo.de. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification">https://aka.ms/LearnAboutSenderIdentification</a> ]<br>
<br>
Am Montag, 10. März 2025, 19:24 schrieb Axel Spoerl:<br>
> Hi David,<br>
><br>
> I just did some debugging to find out, how KDE Palettes are promoted to the QKdeTheme.<br>
> The blunt answer is: They don't, and they have never been.<br>
><br>
> They were probably meant to be promoted at some point, because QKdeTheme implements an array of QPalette pointers (size == NPalettes == 17).<br>
> So for each palette type, a new QPalette could be constructed from a KDE Palette. But that's not happening. The first record of the array is populated with default constructed QPalette, which is a fusion palette.<br>
> All other records are initialized with nullptr and they remain like that throughout the life time of the QGuiApplication.<br>
><br>
> QKdeTheme just implements font handling. Color wise, QGuiApplications won't blend in with KDE palettes. They just stick with a default fusion palette.<br>
><br>
> That said: I think there's nothing needed right now. But we may want to pimp up QKdeTheme.<br>
> The patch I mentioned factors it out from qgenericunixthemes.cpp. So enhancing the class will become a little easier.<br>
><br>
<br>
Maybe a reason that it doesn't do that much was that Plasma has its own QPT,<br>
so there was never enough pressure to make it better since in the most cases an<br>
application would not use QKDETheme except if it shipped its own Qt or<br>
something similar.<br>
<br>
I've written  very small program that prints the resulting QPalette from color<br>
schemes. The output for BreezeLight and BreezeDark is as follows:<br>
<br>
/usr/share/color-schemes/BreezeLight.colors<br>
QPalette(resolve=0x7ffdffffefffff7f,"WindowText:[Active:#ff232629,Disabled:#ffa0a1a3,Inactive:#ff232629],Button:[Active:#fffcfcfc,Disabled:#fff0f0f0,Inactive:#fffcfcfc],Light:[Active:#ffffffff,Disabled:#ffffffff,Inactive:#ffffffff],Midlight:[Active:#fff6f7f7,Disabled:#ffebedee,Inactive:#fff6f7f7],Dark:[Active:#ff888e93,Disabled:#ff82878c,Inactive:#ff888e93],Mid:[Active:#ffc4c8cc,Disabled:#ffbbc0c5,Inactive:#ffc4c8cc],Text:[Active:#ff232629,Disabled:#ffaaabac,Inactive:#ff232629],ButtonText:[Active:#ff232629,Disabled:#ffa8a9aa,Inactive:#ff232629],Base:[Active:#ffffffff,Disabled:#fff3f3f3,Inactive:#ffffffff],Window:[Active:#ffeff0f1,Disabled:#ffe3e5e7,Inactive:#ffeff0f1],Shadow:[Active:#ff474a4c,Disabled:#ff474a4c,Inactive:#ff474a4c],Highlight:[Active:#ff3daee9,Disabled:#ffe3e5e7,Inactive:#ffc2e0f5],HighlightedText:[Active:#ffffffff,Disabled:#ffa0a1a3,Inactive:#ff232629],Link:[Active:#ff2980b9,Disabled:#ffa3cae2,Inactive:#ff2980b9],LinkVisited:[Active:#ff9b59b6,Disabled:#ffd6bae1,Inactive:#ff9b59b6],AlternateBase:[Active:#fff7f7f7,Disabled:#ffebebeb,Inactive:#fff7f7f7],ToolTipBase:[Active:#fff7f7f7,Disabled:#fff7f7f7,Inactive:#fff7f7f7],ToolTipText:[Active:#ff232629,Disabled:#ff232629,Inactive:#ff232629],PlaceholderText:[Active:#ff707d8a,Disabled:#ffc2c8ce,Inactive:#ff707d8a],Accent:[Active:#ff3daee9,Disabled:#ffe3e5e7,Inactive:#ffc2e0f5]")<br>
<br>
/usr/share/color-schemes/BreezeDark.colors<br>
QPalette(resolve=0x7ffdffffefffff7f,"WindowText:[Active:#fffcfcfc,Disabled:#ff686a6c,Inactive:#fffcfcfc],Button:[Active:#ff292c30,Disabled:#ff272a2e,Inactive:#ff292c30],Light:[Active:#ff393e43,Disabled:#ff383d42,Inactive:#ff393e43],Midlight:[Active:#ff2e3337,Disabled:#ff2d3136,Inactive:#ff2e3337],Dark:[Active:#ff131516,Disabled:#ff121415,Inactive:#ff131516],Mid:[Active:#ff1c1f21,Disabled:#ff1b1d20,Inactive:#ff1c1f21],Text:[Active:#fffcfcfc,Disabled:#ff606263,Inactive:#fffcfcfc],ButtonText:[Active:#fffcfcfc,Disabled:#ff6d6f72,Inactive:#fffcfcfc],Base:[Active:#ff141618,Disabled:#ff131517,Inactive:#ff141618],Window:[Active:#ff202326,Disabled:#ff1f2124,Inactive:#ff202326],Shadow:[Active:#ff0e0f10,Disabled:#ff0d0e0f,Inactive:#ff0e0f10],Highlight:[Active:#ff3daee9,Disabled:#ff1f2124,Inactive:#ff1b4155],HighlightedText:[Active:#fffcfcfc,Disabled:#ff686a6c,Inactive:#fffcfcfc],Link:[Active:#ff1d99f3,Disabled:#ff164160,Inactive:#ff1d99f3],LinkVisited:[Active:#ff9b59b6,Disabled:#ff402b4c,Inactive:#ff9b59b6],AlternateBase:[Active:#ff1d1f22,Disabled:#ff1c1e20,Inactive:#ff1d1f22],ToolTipBase:[Active:#ff292c30,Disabled:#ff292c30,Inactive:#ff292c30],ToolTipText:[Active:#fffcfcfc,Disabled:#fffcfcfc,Inactive:#fffcfcfc],PlaceholderText:[Active:#ffa1a9b1,Disabled:#ff42464a,Inactive:#ffa1a9b1],Accent:[Active:#ff3daee9,Disabled:#ff1f2124,Inactive:#ff1b4155]")<br>
<br>
The code that turns those color schemes into QPalettes is here: <a href="https://invent.kde.org/frameworks/kcolorscheme/-/blob/master/src/kcolorscheme.cpp#L580">
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Finvent.kde.org%2Fframeworks%2Fkcolorscheme%2F-%2Fblob%2Fmaster%2Fsrc%2Fkcolorscheme.cpp%23L580&data=05%7C02%7Caxel.spoerl%40qt.io%7C1fde212a5ffc42b896ec08dd607830bf%7C20d0b167794d448a9d01aaeccc1124ac%7C0%7C0%7C638772791535030807%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=7QRCRNTOir7zNA0SxXNOx937hndZeT0dC8Dhu3AMS%2B4%3D&reserved=0</a><br>
<br>
David<br>
</div>
</span></font></div>
</body>
</html>