Hey, im creating a desktop application with compos...
# compose
s
Hey, im creating a desktop application with compose multiplatform, and im having issues applying a theme. Im using material3 components, using the generated AppTheme + colors. Some elements like cards and buttons get colored, but the background of the window is white and all text is statically black. Isnt it supposed to color that automatically as long as i wrap everything in my AppTheme, forcing useDarkTheme to true?
a
It happens when you mix same-named M and M3 composables. Make sure all of your components are actualy imported as material3.
s
Im pretty sure thats already the case: Only icons are still there, which shouldnt be an issue right?
Do Composables like "Column" count? If so, how do i switch them to m3?
🚫 1
Maybe im not wrapping everything correctly then? I got this hirachy: Button -> Column -> Window -> AppTheme Is this correct?
a
Have you tried placing AppTheme inside Window?
s
Yeah, tried wrapping my column in it too, sadly no change
Not even the Text is changing the color to something light, even though im using the M3 Version
This is inside my window:
Copy code
AppTheme(useDarkTheme = true) {
    Column(
        modifier = Modifier.fillMaxSize()
    ) {
        Text("About OneGit v${build.version}")
    }
}
Comes out like this
a
Is behaviour the same when you wrap your column with
Scaffold
or
Surface
?
s
holy cow i knew i was missing somethihng
So sorry. Thank you for your help. Thats it.
I was going mad. I knew i was missing something from the last time i (probably) had to figure out the same thing again
a
Those components are requred to apply correct background and content color
thank you color 1
s
Yeah no makes perfect sense. Thank you :)
👍 1
short follow up, is it possible to set the Window Theme under windows?
Outside of Windows Settings i suppose
a
What do you mean by window theme?
s
The Title Bar, not sure what its called in the lower level
Thats probably statically dictated by the users settings in windows, yeah?
a
Title bar color is not a trivial change. You can try it with AWT look&feel. I use https://github.com/JetBrains/jewel (another way)
s
Oh yeah, i actually remember using something for a swing application of mine. Maybe i can somehow inject that, thank you 🙂 Great pointer already
1