Is there any guide with useful compose desktop tip...
# compose-desktop
p
Is there any guide with useful compose desktop tips? for example, after a lot of research, I can't find even a simple thing as displaying the window centered on the screen. Also I see that in the sample project generated by the wizard, I don't have folders for theme, styles, texts... and whould be nice to have them, like in android. But I'll need a little help about how to create them and use them manually... or maybe doing things differently. Anything that can help will be appreciated.
m
You can find some desktop-specific information here: https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials
p
thank you Michael, I already navigated that section, but can't find there how to center the window on the screen
also can't find there how to manage theme, styles, texts... etc
in android we got folders for texts, resources etc..., and kt files with themes and styles
we got the xml for the texts
here does not exist, and I wonder how to manage these kind of things on compose desktop
m
p
that's nice, I wonder why is not activated by default in any KMP project or Compose Desktop project
maybe do you have any info about how to manage themes/styles and how to center window on the screen?
m
In your main where you create the window you just have to specify the desired alignment:
Copy code
val windowState = rememberWindowState(size = DpSize(1200.dp, 900.dp), position = WindowPosition(Alignment.Center))
For the theming you can have a look here: https://developer.android.com/develop/ui/compose/designsystems/material (By default desktop is still using material 2)
p
thank you very much for centering trick, they should add it to the documentation
about the theming, that link is for Android, you mean that if I create the theme.kt, type.kt, color.kt files and use them in the same way as in Android in composables, it will be the same?
đŸ‘Œ 1
thank you!
I'm starting a new thread
m
Resources are handled slightly different (e.g., Res vs R) but that’s described in the documentation.
p
But it was not possible for me to find how to do this, I was not possible without your help
the organization of everything
wait a second I'm starting a new thread here