Vision for theming in Kirigami applications?
Our theming story for Kirigami applications is in a bit of a weird situation.
In principle Kirigami is designed to be theme-agnostic. We don't assume any particular QQC2 style and even have a mechanism to load different "appearances" for controls based on the used QQC2 style. We also have a plugin mechanism to load colors and other platform integration.
In practice we mostly use and test it with qqc2-desktop-style, and to a lesser extend with qqc2-breeze-style (on Plasma Mobile and Android). With other styles like Material or Universal it tends to be quite broken. Partly this is a result of us not testing it properly, but partly it's a result of QQC2 themes not being as interchangeable as one would want.
qqc2-desktop-style provides implicit themeability through QStyle, but that has its own limitations. In particular it relies on colors from KColorScheme, which leads to poor results on non-Plasma unless we force it to use Breeze colors
With Qt6 there's also some sort of "native" QQC2 style, which doesn't do anything for Linux currently but is something worth exploring conceptually.
There's also an early effort towards a "unified" theming engine (https://invent.kde.org/ahiemstra/union).
On the technical side there's a challenge: The QQC2 theming approach is incompatible with current QML compiler technology (qmlcachegen and qmltc) so we are losing out on performance. I don't have numbers on how much. Currently the only way around that is hardcoding a style at compile time. I don't know if that is ever going to change.
I have more questions than answers for this right now. In particular:
- How much do we care about using Kirigami with arbitrary QQC2 styles?
- On non-Linux (or even non-Plasma) Platforms, do we prefer looking "native" or looking like on Plasma?
- Assuming we have a universal theming engine, can we/do we want to hardcode that to be used on all target platforms (Plasma, non-Plasma Linux, Windows, Android, macOS)?