Replies: 2 comments
-
A better approach to this would be something like this, but there is currently a bug that prevents this from working. I will fix this soon, so do not try to figure out why this code is not working now; it should work soon. o := gi.NewButton(inputs).SetText("open").SetIcon(icons.FolderOpen)
o.OnWidgetAdded(func(w gi.Widget) {
if lb, ok := w.(*gi.Label); ok {
lb.Style(func(s *styles.Style) {
if o.StateIs(states.Hovered) {
s.Font.Size = units.Dp(17)
} else {
s.Font.Size = units.Dp(14)
}
})
}
}) |
Beta Was this translation helpful? Give feedback.
-
In addition to implementing button animations, this feature should be useful for implementing such widgets https://primevue.org/dock/ |
Beta Was this translation helpful? Give feedback.
-
Hi, how to set font size when mouse enter and leave
Changing the font size and color through the entry and exit events of the mouse can animate controls such as buttons
Beta Was this translation helpful? Give feedback.
All reactions