I thought I'd summarise my experience of exploring...
# compose-desktop
v
I thought I'd summarise my experience of exploring theming on Jetpack compose desktop - there's been a few questions about it on this slack recently. I'm torn between fighting Material3, switching to Jewel, or abandoning the desktop for now. https://www.cantilevers.org/corbel-authentication-and-ui . (My custom static website generator project doesn't handle CSS yet, it's as plain as they come...).
👀 1
💯 1
👍 1
s
Great writeup!
m
It would be nice if you could talk a little bit more about what exactly makes Material not so useful for desktop apps. I have written some desktop apps too and did use Material for it. To my experience the main distinction you have to make is whether the user uses a pointer (mouse) or touch screen input device. Material is obviously designed for touch screens and thus the size of the controls is often too big for people mostly using pointer devices on their desktop. One special problem is the TextField which becomes unusable when you make it smaller than intended. But with a little trick this problem can also be solved. So, what else is there that you would like to change?
s
I'm sorry Jewel doesn't answer to your needs yet, but as you noted, it's primarily geared towards implementing the JetBrains IDE design systems and deep customisation of accents isn't really a priority for now. I think with something like Arrow Optics you could alleviate a lot of the customisation pains, but one day I'd like to be able to offer an easy way to at least choose accent colours. To be able to do that, however, will require first the design system specs to change... And I can't commit others' time on this
We have a table component on our roadmap, but no firm ETA for it. Creating a proper LazyTable component is not trivial; we don't plan to provide an extremely complex table, and many complex features are better implemented in the data layer (e.g., filtering, sorting, etc). We find that for the main use cases, a simple table component is enough, however. It's outside of Jewel's scope to create complex composite components, and it's also not fitting of the Compose philosophy of, well, composing simple parts together to obtain complex interfaces.
That said, I hope we'll figure out a way to improve our API to make theming easier in the standalone component; it's not a priority, as we're mainli focusing on the Swing LaF bridge for use in the IDE, but something we've got on our radar nonetheless. Our API design is bound to change again pre-1.0 as we try to strike a difficult balance between supporting essentially multiple "themes" in a single Compose theme, and avoiding Byzantine and unintuitive usage patterns
We're currently not committing to API stability — that's something that will come with 1.0
v
Thank you all for the feedback. @seb I really hope I haven't come across as unfair in my critique of Jewel, it's very close to what I'm looking for. It's in my nature to always poke at a library or tool to see how I can customise it, perhaps that's unfair of me :)
@Michael Paus I will give some serious thought to Material3 and your very fair question. I might just be unfairly subjective (I really dislike the default Material purple colour!) but I think, I hope, my issues are little more substantive than that. I'll give it some thought and update the post if I have more to say. And in the meantime I'll try harder to learn how to customise Material3.
m
@v79 I share your judgement, that Material is not perfect for desktop development but as you have already found out it seems that, at least for a while, we have to live with it. My wish though is to gather more knowledge about specific shortcomings and how they might be overcome. For example I wrap my compose code at the top level with something like this:
Copy code
val isTouchDevice = remember{ myCurrentDevice == PrimaryDevice.TOUCH }
CompositionLocalProvider(LocalMinimumInteractiveComponentEnforcement provides isTouchDevice) {
   ...
}
If
isTouchDevice
is false, the minimum interactive component enforcement of Material is switched off and things can look much more desktop-like now. I’d just like to see more of such hints to improve Material for desktop use.
s
@v79 absolutely, that is a fair assessment and there isn't anything I object to
k
Please file a bug on Aurora with details on what didn’t build for you