mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
widget/material: add focus and hover indicators to Clickable
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -94,6 +94,9 @@ func Clickable(gtx layout.Context, button *widget.Clickable, w layout.Widget) la
|
||||
return layout.Stack{}.Layout(gtx,
|
||||
layout.Expanded(func(gtx layout.Context) layout.Dimensions {
|
||||
defer clip.Rect{Max: gtx.Constraints.Min}.Push(gtx.Ops).Pop()
|
||||
if button.Hovered() || button.Focused() {
|
||||
paint.Fill(gtx.Ops, f32color.Hovered(color.NRGBA{}))
|
||||
}
|
||||
for _, c := range button.History() {
|
||||
drawInk(gtx, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user