mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
widget/material: add hovered to RadioButton
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
+8
-1
@@ -10,7 +10,8 @@ import (
|
||||
)
|
||||
|
||||
type Enum struct {
|
||||
Value string
|
||||
Value string
|
||||
Hovered string
|
||||
|
||||
changed bool
|
||||
|
||||
@@ -56,6 +57,12 @@ func (e *Enum) Layout(gtx layout.Context, key string) layout.Dimensions {
|
||||
}
|
||||
}
|
||||
}
|
||||
if e.Hovered == key {
|
||||
e.Hovered = ""
|
||||
}
|
||||
if clk.Hovered() {
|
||||
e.Hovered = key
|
||||
}
|
||||
clk.Add(gtx.Ops)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user