widget/material: add hovered to RadioButton

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2021-01-17 18:28:45 +02:00
committed by Elias Naur
parent 0b736990a9
commit bc6798c4ca
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -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)
}