Hey, there. I upgraded to Compose 1.7.1 and now my...
# compose-desktop
m
Hey, there. I upgraded to Compose 1.7.1 and now my cursor does not change anymore when hovering over Buttons. Usually it should change to this pointer-cursor, but it doesnt.. I'm on macOS. Does anybody else have this issue?
a
I think buttons have always had the default pointer icon unless otherwise specified. But you can change it with, e.g.
Copy code
Button(
            onClick = {},
            modifier = Modifier.pointerHoverIcon(PointerIcon.Hand)
        ) { 
            Text("Button")
        }
m
I also think that.. but since I upgraded the version, the new default seems to be the normal cursor. If I explicitly set this modifier it works but I really dont want to change this in 100+ buttons around in my app 😅
a
The default has always been the normal cursor is what I’m saying.
m
Yes, but in my case, its not working per default. I created a whole new compose desktop project via intellij wizard (Kotlin 1.9.22 & Compose 1.6.0 - defaults) and it doesnt work without explicitly adding the Modifier to the button 😅 I'm on macOS Sequoia 15.1.1
a
Yes, I understand. This is the expected behavior.
m
Ohhhhhh, Im so sorry - I completely understood you wrong
pardon :d
a
No worries
m
The lack of a CSS equivalent in Compose is a problem 😞 In JavaFX this would be three lines of code.
a
It’s one line of code in Compose
m
but for each component
a
fun MarcButton(…)
m
But then I would also need to change all the buttons in my existing project with this new component
a
But only once. And if you want to control styling in a central place in your project, you start the project with that (defining AppButton etc)
m
Doesn't work for libraries that instantiate buttons on your behalf. Composable overriding of properties is something offered by contexts, but contexts aren't used as consistently as CSS is, so often there are properties whose defaults aren't read from contexts.