Kirigami doesn't adhere to platform styles. It should

Was going to add this as a response to the undermentioned. However, this topic is not entirely development-oriented:


One reason that, as a user, I don’t use Kirigami-based applications on my AOSP device is because their GUI is no utterly different to all else.

One of the reasons that I like Qt is that, by default, its platform style differs per platform, attempting to mimic standard controls for the platform. KDE Frameworks tends to override this, although it never applied to AOSP much anyway. Irrespective, Kirigami makes no effort to remediate this.

To compare, I utilize most modern AOSP applications, whether they were created in Flutter or Compose (etcetera) isn’t even noticeable, because they all mimic Material 3 (+You), whereas Kirigami does not even attempt to adhere to my accent colour.

Not adhering to the platform style is a jarring departure from what’s standard, and not for the better.

…It’s even more so when these controls are arcane:

This is relevant because in this case, I’m rather surprised that it doesn’t adhere to the system font by default, if it’s going to be nigh unusable.

Yeah, I suspect what you’re seeing is ultimately the user-facing impact of the developer issue that was mentioned here:

Plus the fact that it sounds like more of a “collection of useful components” than “a vision for applications, with components to help implement it”.

So if the default doesn’t innately work well for mobile, and there isn’t necessarily a unifying, prescriptive view on what principles folks should design toward, it does make sense that things would end up “functional, but feeling clunky”.

1 Like

Kirigami itself can use whatever QtQuick Controls (QQC) style you want, and Qt comes with a Material QQC style. However many KDE apps internally specify what QQC style they want rather than inheriting from the system’s preferred style. Why? A couple of reasons:

  1. The concept of “the system’s preferred style” is only a thing outside of the Linux world; there’s no “GNOME QQC style” or “XFCE QQC style” that such systems will specify for the app to use, because neither the people involved with Qt nor those environments have created such a relevant QQC style for apps to use. As such, this concept only really makes sense when you’re running the KDE app on Windows, MacOS, or Android, where Qt itself provides some QQC styles that attempt to mimic those platforms’ styling.
  2. Even when such a QQC style is available for our apps to use (e.g. on Android), KDE apps often aren’t tested extensively or at all with them. As such, many of the developers decide to play it safe and require the use of the Breeze style. Should we make an effort to move away from this? Probably. But it’s mostly a matter of time and resources; testing your app on a bunch of different platforms isn’t fun or rewarding, and often not possible at all if you don’t have any of those platforms around.

Hopefully that helps to clarify the situation.

5 Likes

@ngraham, yeah, it does. However, for something like Flutter, there appears to be a whole raft of well-designed platform-specific adaptations: [1]

- OS: AOSP 14
  Design: Material 3 + You
  URI: https://m3.material.io/develop/flutter

- OS: macOS
  URI: https://pub.dev/packages/macos_ui

- OS: Windows 11
  Design: Fluent Design
  URI: https://pub.dev/packages/fluent_ui

Is there something about Qt6 (or KDE Frameworks) that makes it more difficult for such to exist?


  1. Automatic platform adaptations | Flutter ↩︎

Qt already does include styles for Android, MacOS, and Windows. I don’t know how good they are because I don’t use them, which I suppose is the issue in question: People need to have the desire to use non-Plasma platforms and want their KDE apps to look native-ish on those platforms before the motivation to make the situation better there will ever materialize.

2 Likes

For comparison, it unfortunately appears that GTK’s AOSP backend doesn’t introduce platform-specific stylisation. (…Yet? It’s in an alpha state.) Though, considering GNOME’s developing it, that might well be deliberate!

Qt does. They just don’t actually work with Kirigami.Theme, so you can’t write portable Kirigami code, you either need to commit your QML to Kirigami.Theme and breeze, or Material.theme et al. on all platforms.

And that’s just if you want to respect the user’s choice of light or dark, let alone any richer UI experience than that.

I don’t know how good they are because I don’t use them,

Which makes all the high level documentation that promises all this sort of stuff works on all the platforms that all the cool kids are using and is “guaranteed to be cross platform” - part of the problem as well.

But I didn’t wake this thread up just to grumble, or to point out that we’re nearly a year on and this:

Kirigami itself can use whatever QtQuick Controls (QQC) style you want, and Qt comes with a Material QQC style

is still an incredibly misleading half-truth, in that you can pick any one style per application that it will use on every platform - but you can’t write portable QML that can be externally styled to look appropriate for the environment its running in.

Or to bang on about how much time I just wasted figuring that out The Hard Way. Or how that’s just the tip of a very big iceberg.

But this thread spun off from the question, We need your thoughts on Kirigami, and it does kind of highlight what I think is a problem that will bite you if it isn’t doing so already.

If you’re open and honest and clear about the current limitations this code has, people wanting or trying to use it will have realistic expectations about what does and doesn’t work, and what they might contribute to if it’s a personal itch of theirs. But if you make grandiose, and untested, promises about how easy it is to write code that looks and works beautifully and seamlessly on all platforms, when people’s lived experience is horrifically different to that, then you will lose people, not just as users, but as contributors. When a problem is clearly indicated, people can efficiently choose to route around it or chip in to help fix it. When it’s not, a lot of everyone’s time becomes wasted, and a very different set of questions comes into play.

It’s great to have aspirational goals - and not all the problems here are directly with Kirigami, it sits at the tip of a large, also work-in-progress, house of cards - but being at the pointiest end of user-facing does mean accepting that the buck stops with you for being the face of user friendly.

When one page of docs “guarantees” everything is cross platform and “perfect for mobile”, and the next page shows isolated partial examples of fundamental features like colour and theming that isn’t actually cross platform and doesn’t actually work on mobile, and doesn’t have a little asterisk explaining that - and doesn’t even fail in obvious and easily diagnosable ways, it just silently Doesn’t Work… Then the job of winning hearts and minds just dug itself a really big hole, and filled it with pointy sticks.

If I’d have been assessing this for a new project instead of trying to bring an existing one up to speed with current versions of its deps … then yeah, I’d probably be busy testing something else instead of writing this with the hopes of a Better Future right now… and you asked, so it’s some honest debrief feedback, which I hope is taken positively even if this time it’s not a pat on the head for Doing Good Things.

1 Like

@Ron, I remember that being my experience a few years ago, but I remain a novice at QML precisely because it doesn’t appear to adhere to the platform style as well at QtWidgets do. Consequently, have you any examples?

They’d demonstrate that either what you state is accurate, or you’ve accidentally missed something. I have been able to utilise the Material and FluentWinUI3 styles in pure QML, but haven’t evaluated whether they’re compatible with Kirigami myself.

Separately from even this current thing I’m working on, QML hasn’t really been doing a very good job of selling itself to me.

It’s probably nice if you’re the author of a GUI “app creator” - because the severe limitations of what you can do with a drag and drop designer map pretty directly to what you can and can’t do in QML, so it makes your job easy and its fine to have unnamed ‘Rectangles’ and ‘Items’ scattered and nested all over the place. But if you’re actually a programmer - then taking away your ability to program solutions to some problem isn’t really A Feature. It’s the Framework Problem with the dial set to 11. You start with all the same problems that QtWidgets handed you, but with even less ability to do something to mitigate them.

So if you’re working with Android, and already paying the price for using ‘native’ code there, adding yet another layer of interpreters to the several layers you already need to deal with just to get one line of text on the screen, might not be the ideal first choice for more reasons than just this problem.

But in my case, it’s not my choice to make, I’m starting from existing code - so I either port all of its QML back to QtWidgets (which long term I’m not taking off the table yet), or try to make its current code work with Qt6.9 and Android 16 with the minimal number of changes. And that seemingly simple job got so bogged down in repeatedly crashing hard into dead ends of mutual incompatibility with current tooling, that I figured I should take my minimal hello-world that I tested the Android build environment with and turn it into a minimal Kirigami example I could use for testing and reference to update this other app.

And that’s where the nightmare really began. The internet is full of examples of doing that, with varying degrees of being ‘official’. Half of them are still for Qt5 and haven’t been updated in 6 - 9 years. None of them work out of the box with current HEAD of all the things they use, and all of them are in varying states of using things that have since been superseded or for which there are multiple competing implementations.

There’s the google way of doing things - because they ship their own cmake tooling that their SDK tools assume you’re using - actually they ship two to choose from, because both of them break in different ways with different use cases. And there’s the ECM way of doing things, which some of the KDE deps assume you must be using, and some of which will almost but not quite fall back to the Qt implementation when you have a New Enough Qt.. And there’s the Qt way of doing things, which reimplemented much of what ECM pioneered, but changed all the configuration and output variable names again, along with some of the behaviour … And then there’s dozens of end-user permutations where “some from column A, some from column B” is what people were able to make work over the years, all of which probably stopped working just a few releases after they were created or only work under strictly controlled pre-conditions.

And those independent implementors don’t appear to be talking to each other or to their users, and even themselves seem to know they’ve created such a horrible convoluted mess that they can’t and don’t give you a minimal working raw code example - they just fall back to “use our designer GUI, it’s all hidden behind that”, and use our special build tooling, where we hid the rest of Too Hard To Explain. And so now you faceplant into another mutually incompatible choice - especially if you’re starting from existing code that wasn’t built with or designed to use any of those things, and may itself have it’s own string and duct tape build tooling, which is the reason this hasn’t been updated since early Qt5 in the first place because everyone is too terrified that Touching Anything with Break Everything.

And that fear, I’m living proof to report, is not unfounded.

But after very painfully, and piece by piece repeatedly, discovering exactly why none of what people had documented as “current best practice” actually still was, or even still worked - I think I’ve finally got close to the currently un(der)documented what actually is and does with the current release versions.

And that’s when this little rude surprise sprung itself on me - right when I was thinking “cool, the Hard Part is done, I have a baseline now, I’ll just take a couple of minutes to make it respect the system dark or light theme, then wrap this up and get back to the original job”.

And yeah, I’m totally skipping over the part of this train wreck that is “splash screens” - because again, I’m not writing this to angrily vent my spleen before I rage quit. I’m sharing a real user story to hopefully give a little bit of productive perspective on what actually still remains to be done to make this a practically useful tool for developers. And spoiler alert - it’s not “add yet another language binding to make it easy for newcomers who only speak one language”. Until the fundamental promises being made are things that actually work for people who aren’t scared away by that, that’s not the show-stopper problem here.

Consequently, have you any examples?

I was planning to push this example code to public git, partly to try and save/warn others from/of the pain I’ve just been through - and partly as a ‘living bug report’, that will hopefully get the official documentation improved, or stand in for it until it is, and maybe shake out a few pointers to things that could still be done better or cleaner than I’ve already done them.

Once I’ve got this bit of the mess that it became while trying to find a way to make this work cleaned up as best it can be again I’ll look at doing that.

I have been able to utilise the Material and FluentWinUI3 styles in pure QML, but haven’t evaluated whether they’re compatible with Kirigami myself.

See the side thread that runs from here: Styling Kirigami applications wtih custom QtQuickControls Style - #25 by Ron when I thought that error was evidence of a problem in what I had done that I needed to fix - before tracing through enough of the code to realise that it was a “situation normal, this is never going to work until kirigami is fixed” warning that kirigami didn’t actually support the QQC styles - the only way to use them is to ignore Kirigami.Theme and hardcode use of the QQC style directly in your code. Realising that and searching for any known answers was how I found this thread.

And it’s even worse because if you specify no styling (and don’t bundle breeze) then Kirigami will default to Material on Android, but not to Material.System which respects the user’s device setttings.

I’d be ecstatic to be horribly wrong about this, and see someone say “dude, what are you banging on about, you just need to do X, and all of this really does Just Work” - because that’s what I believed a couple of days ago… but at this stage that hope is fading pretty quickly with every new piece of evidence I unearth.

It’s not even a “worst fears coming true” thing - this seems like functionality so basic and fundamental that it’s more like finding out the Easter Bunny isn’t real and the factory that makes chocolate eggs is broken and can only make the foil wrappers for them. It’s not at all what the more naive and trusting me from a few weeks ago was led to expect.

1 Like

@Ron, although (or because) I’ve not the competence you have, I can confirm that that’s been my experience. After trying really hard to get Kirigami and QML working, I’ll (at least, for the meantime) revert to QtWidgets. I’ve been assured, barely last month, by Qt developers, that it’s not even deprecated in favour of QML. [1]

From the thread that you cited, Union may massively improve this. I’ll wait to see.


  1. forum.qt.io/post/829549 ↩︎

@Ron Yeah, a lot of this is a series of specific examples of the general thing I wrote before: that KDE developers don’t use or test with the upstream non-KDE styles, so there are likely many holes in the experience there.

One specific thing: can you clarify what you mean when you say that Kirigami.Theme stuff doesn’t work with non-KDE QQC styles? Which parts specifically? Which things?

1 Like

Basically ‘everything’ … I’d been trying to start with the simplest possible example of a kirigami ‘hello world’, brought up to date with the (moving target) ‘current best practice’ for all the component parts, that respected the bounds of the device safe area and the users’ choice of a light or dark system theme. Ideally using the ‘most native looking’ theme on each platform.

And that essentially doesn’t seem to be possible right now, in practice you need to pick one theme and use it everywhere.

I was able to make the colour part somewhat work with Material by hardcoding things like:

Material.theme: Material.System
color: Material.backgroundColor

because if I used color: Kirigami.Theme.backgroundColor in something like a Rectangle that otherwise just always defaults to white, it would give me some different colour again, which was always light, and not derived from the Material theme. I had to totally ignore Kirigami.Theme, and commit to hardcoding use of Material in the qml for every platform if I stayed on that path. (or duplicating all the QML for each of them, but that’s not a sane or realistic answer either)

Ditto for the default colours I would get if I didn’t force them with a Material.* colour.


I’m having slightly better results with committing to use (the much less minimal option of) Breeze everywhere.

Right now, the ugliest bits of that which I’m still trying to figure out are:

  • having to hand hack org/kde/guiaddons/KWindowInsetsController.java and libplugins_kf6_kirigami_platform_org.kde.breeze.so into the APK. I still haven’t figured out which bit of automagic I’m missing to have them pulled in ‘normally’.

  • If or how I can tweak the outline contrast of Controls in the Breeze dark theme. When they are drawn on Kirigami.Theme.backgroundColor they are almost invisible when they are not selected/activated. The border highlight around them needs to be lighter to be visible in the dark theme.

And there are still a few things, though not as many as before, which spill out of the safe area - and I’m seeing the CI built alligator APK do that too, so that’s probably not something I’m Doing Wrong (or if it is, we all are! : )

Along with lots of other little paper cuts in the job of trying to get all the KF dependencies to build and play nice with each other. But they themselves seem to be victims of ‘best practice’ being a moving target and the many ways that historically people have hacked their way around that problem - even with them having very strict dependencies on the most recent versions of many of their deps.

Is there a good matrix channel to lurk in once I’ve got this into some sort of “working enough to share” state? I’m currently juggling a lot of plates, but there’s a lot of contradictory and/or out of date documentation and examples which actually made this job much harder than it should have been, so it would be nice to bounce some of this off the people maintaining that and figure out which of these versions of things are actually True and Best Practice today.

Grumbling about horribly broken stuff is really only useful when it reaches the right ears to do something practical to improve things! And I’m more interested in the useful improvement bit than the grumbling …

1 Like

The Kirigami matrix room is https://matrix.to/#/#kirigami:kde.org

1 Like

This is something that bugs me as a user, though I understand that Qt and Kirigami are wonderful tools given the graphical consistency of Plasma and the amount of work I read of regarding accessibility.

I tried installing some KDE apps in Android but I quickly uninstalled them, not only because Kirigami doesn’t adhere to “styles”, rather because it does not adhere to “experience”: even if Google is pushing a lot of strange things with Material design — look at how much more padding we have each iteration —, it is very good for touch-screens. Positions, sizes, and colours of components make it less so for Kirigami.

I’m sure I’m missing something and that one explanation can be that convergence is really complex, at least when talking about mobile platforms. Regarding the issue as a whole, it seems like a very deep discussion on the tooling itself, which I couldn’t understand.

1 Like

I recently started using QT apps on my PC, and Kirigami apps are the ones that don’t use QT styles correctly. They have parts that are clearly QT Breeze, which goes against the system’s customization.

Of the QT styles, I like Oxygen the most; it looks nicer, more modern, and different from the default, but I can’t use it properly in Kirigami apps.

This gives the impression that KDE will make the same decision as Gnome: a decision to go against customization.

1 Like

This feels like an undue exaggeration: KDE is renowned for the customisation it offers and using QT is by itself a good choice for convergence and adherence to platform styles. It just happens that Kirigami needs to be fixed and this thread addresses it, while everyone thinks enabling customisation is the way to go.

It seems like the thread is going in the right direction with @Ron listing issues and contacting the Kirigami matrix room.

1 Like

Linux in general was known for its customization, including Gnome and GTK, but that was a long time ago. Nowadays, Gnome is very anti-customization.

So, obviously, people will be afraid that this kind of thing will also happen to KDE. Anything that goes against customization will give the impression that the developers are trying to get rid of customization.

For example, Flatpak and Snap apps also have limited customization.
I downloaded the Flatpak version of the Dolphin emulator, and I couldn’t even use the QT Oxygen style; it automatically selected the Breeze style.
And Snap apps that use the kde-neon-6 extension currently don’t support Kvantum.

So, interface customization is increasingly diminishing, and Kirigami apps give even more of the impression that customization is being purposefully eliminated.

The past and what is said currently may be one thing, but what is being communicated to the user through actions is quite different.

There is some intentional decision on the part of application developers to sorta-enforce Breeze on most platforms because it just looks good and so that things don’t accidentally break elsewhere because they themselves don’t really test other themes.

I say “sorta-enforce” because it’s technically not really enforcing, it’s just a check in each individual application’s code that says “if we’re not on Plasma, use Breeze by default, but it’s overridable!”.

There is no intentional decision to make KDE stuff not customizable. That’s not really how it works. Integration problems might happen and if those are not fixed they stay unfixed.

That, and again, there are bugs in Kirigami that need adressing as mentioned above.

1 Like

Are Kirigami apps so dramatically different from other QT apps that they really need the QT Breeze style?

I recently started using QT using PyQt6. So far, the Windows and Oxygen styles have been very consistent. I haven’t seen anything where Breeze seemed necessary. In fact, I’ve even seen Breeze look different than expected.

Like this example, where the QT Oxygen, Windows, Fusion, and kvantum (KvCyan) styles accurately display the QScrollArea size, while the QT Breeze style doesn’t.

“Technically”, it technically really is …

it’s just a check in each individual application’s code that says “if we’re not on Plasma, use Breeze by default

Which, as I just learned the hard way, each individual application added after its author learned that using anything other than Breeze on mobile just means almost everything related to styling will be broken.

but it’s overridable!

In the same sense that “having a steering wheel in my car is overridable”. Sure I can take it out and still drive it - but nobody is going to want to.

So it’s a bit of a cuts both ways thing - users will get immensely more annoyed if developers don’t use Breeze - meanwhile developers get frustrated because they keep being told “you can use another style if you want to”, without the full disclosure of all the things that won’t work if you do, or what needs to be worked on if you want to help fix that.

Which indeed, isn’t the same as it being an intentional policy of limiting choice - but for people new to this, it’s a clearly a ‘broken step’ - so it does have the flavour of “the things you ignore are the things you accept”, and is a very real technical limitation.

Breeze on most platforms because it just looks good

Strictly speaking, that’s not completely true either. With a dark system theme on current android, most of the controls that aren’t actively highlighted are almost invisible, there’s not enough contrast in the outlines to clearly see them. And anything using Kirigami.Theme.Complementary becomes simply dark on dark instead of actually still complementary, so its no longer a highlight.

[Edit: - If anyone reading this does care about bugs in Breeze with a dark system theme, there also seems to be a glitch on Android where the first time the global drawer is opened, the actions in it will be drawn with a light theme, even though the drawer as whole is otherwise dark. When its later opened again, they are styled correctly.]

And you can’t even really take guidance from the official tutorials, because nobody is updating them, so many things either simply don’t work at all (because what they are using no longer exists in current kirigami versions), or don’t do things in the presently required way needed for things to operate correctly.

Right now, for me, the battle has moved to SafeAreas, and some of the crazy non-deterministic behaviour that occurs trying to respect them when behind-the-scenes adjustments somewhere between Qt and user code turns bound properties into hard constants and ensuing layout chaos …

I do totally (and viscerally) appreciate the problem of Developer Time - but all these things I’ve been grumbling about would just be simple bug reports or feature requests or things to contribute if they were openly acknowledged and documented as Very Well Known Limitations of the current code base. And the time I’ve wasted on learning they exist when the front-end marketing makes bold promises about how all of this already Just Works would have been much better spent on doing just that kind of thing. So it’s the gulf between what is promised (and apparently by some, genuinely imagined to already exist), and what actually really exists today - which is the source of disillusionment and frustration for people trying to do something new, and new looking, with it.

It is a bit of a vicious cycle - but I think if you really want to break it there needs to be a clear distinction between “The Dream Of What We Hope One Day This Will Do” and “What it actually can really do today, and this week’s idiom for doing it”.

A vision to aspire to is important - but it’s much harder to get from here to there if almost nobody actually knows where here really is.