https://kotlinlang.org logo
Title
k

Kirill Grouchnikov

06/07/2021, 11:05 AM
Looks like querying OS light/dark mode is on the way to Compose Desktop via Skiko - https://github.com/JetBrains/skiko/pull/118
🎉 3
d

Dominaezzz

06/07/2021, 11:44 AM
Surprised it's being done on the skiko level.
k

Kirill Grouchnikov

06/07/2021, 12:17 PM
I guess it's technically not Skia bindings, but given that it involves platform specific native API calls, it wouldn't conceptually belong in Compose Desktop.
☝️ 1
👍 2
c

Colton Idle

06/07/2021, 3:55 PM
Oh this is awesome and super timely for me. Thanks for posting! Also, I know I can just search google for these file extensions... but .cc and .mm? What is that all about?
o

olonho

06/07/2021, 4:13 PM
Skiko is universal low level UI library for needs of Compose
k

Kirill Grouchnikov

06/07/2021, 4:20 PM
Might want to expand the description of Skiko
@Colton Idle -
.mm
is for Objective C files (on macOS).
.cc
is the "regular" C++ file extension, also used interchangeably with
.cpp
c

Colton Idle

06/07/2021, 4:59 PM
Thanks. TIL!
e

ephemient

06/07/2021, 5:04 PM
usually .m is for Objectives-C, .mm is for Objectives-C++ ( objc mixed with c++)
🕵️‍♂️ 1
t

tad

06/08/2021, 4:48 PM
My kingdom for a GTK to Compose theme translator
k

Kirill Grouchnikov

06/08/2021, 6:43 PM
There's certainly a precedent of a sorts in the Swing world. https://github.com/JFormDesigner/FlatLaf provides support for loading IntelliJ themes (in the original json format) in Swing apps. However, there's a lot of work involved there trying to bridge the gap, if you will, between two theming systems (even though IntelliJ itself is a Swing app, they chose a theming approach that is not 100% compatible with Swing look-and-feel UI delegates)
So a GTK -> Compose would need two big parts. The first part is a parser that can handle everything in a file like https://github.com/i-mint/bluesky/blob/master/BlueSky-Mountain-Dark/gtk-3.0/gtk.css. The second part will probably be much bigger - if you want to actually support every single thing in a GTK theme, you're going to end up writing a whole new collection of components that support all of these attributes. I don't think you'd be able to map all of them to Material components and attributes.
t

tad

06/08/2021, 6:46 PM
Oh totally. I'm not saying it's feasible. I think a better approach would be to adapt Compose to generate Gtk views.
k

Kirill Grouchnikov

06/08/2021, 6:47 PM
Absolutely feasible. As long as you're willing to implement a collection of UI components that match the API surface of Gtk
Not sure what you mean by "adapt Compose to generate Gtk views"
t

tad

06/08/2021, 6:48 PM
I mean implement an Applier and Node to output Gtk views
basically make a compose-gtk
d

Dominaezzz

06/08/2021, 6:48 PM
Like compose-web and dom.
k

Kirill Grouchnikov

06/08/2021, 6:49 PM
I'm not sure how that would work, but certainly would cost less than a kingdom for somebody who's interested in it