https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
m

martmists

09/07/2023, 9:32 AM
Does Compose offer a way to use the system's GTK theme instead of MaterialTheme?
m

Marcin Wisniowski

09/07/2023, 10:39 AM
Compose cannot use the GTK theme, but you can of course make your own Compose theme and don’t have to use MaterialTheme.
v

v79

09/07/2023, 10:54 AM
tl;dr is that it is a lot of work and the only substantive projects are Jetbrains Jewel, Aurora, and a macOS theme I don't have a link to.
k

Kirill Grouchnikov

09/07/2023, 2:43 PM
Some time ago in a universe far far away, Sun tried using native APIs to render Swing widgets to “look” native. So on Windows, they used Windows APIs to paint buttons, comboboxes, scrollbars, etc. Under GTK they used GTK APIs. See https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java for the native bindings, and elsewhere in the same package for how they are used in the UI delegates. That was pretty awful though. You can maybe get 75-80% there in terms of base rendering, but it quickly falls apart at the “seams” where you have mismatch between the APIs your widget supports (in terms of visual state, layout, etc) and what the native APIs support. For me, the worst thing in the “native” Windows look-and-feel at that time were animations. There’s really only so much you can recreate with these native APIs when your UI components are very much not native. The macOS theme I linked above was emulation instead of calling native APIs. That can also get you so far, and you’d need to try and catch up with changes in the underlying OS changes every year.
Long story short, what we’re seeing on the web, as well as with a few select desktop apps such as Slack, GitHub Desktop and the whole line of Jetbrains’ IDEs is - the native look fidelity is not as important. What is important is the feature set of the app itself, and then after that the integration with native functionality such as drag and drop, system tray, notifications, URL handling, etc - that are sometimes in the UI realm, and sometimes not.
v

v79

09/07/2023, 3:04 PM
It is an interesting discussion. There was a time - in the early 2000s, perhaps - when configurability and theming was everywhere. You might remember Winapp skins, or the crazy theming options for Linux window managers like Enlightenment... Obviously things have moved on and flatter, minimal and sane-by-default styling is the modern approach. I think Material3 is a poor fit for desktop apps (it was the TabBar that finally made me want to try something else). Jewel is much better, but I had hoped for a little more straightforward configurability of colour. Gtk themes can be quite interesting, three-dimensional, visual effects, and so those would be hard to offer colour variations. But Jewel is very flat and about the only configurable thing you'd hope to change is the colour palette, and sadly that's not really practical just now. I get the priorities, of course. It is as much a limitation of Compose as anything. Interesting, as I say!
k

Kirill Grouchnikov

09/07/2023, 3:06 PM
Jewel is very much aligned with its mission (as every project should) - bring the specific look-and-feel of IntelliJ themes to be also available in Compose. It being flat is not a limitation of Compose. It being less configurable is also not a limitation of Compose.
11 Views