forked from joejulian/gio
widget: reset focused states when disabled
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -112,6 +112,8 @@ func (b *Clickable) Layout(gtx layout.Context, w layout.Widget) layout.Dimension
|
|||||||
b.click.Add(gtx.Ops)
|
b.click.Add(gtx.Ops)
|
||||||
if !disabled {
|
if !disabled {
|
||||||
key.InputOp{Tag: &b.keyTag}.Add(gtx.Ops)
|
key.InputOp{Tag: &b.keyTag}.Add(gtx.Ops)
|
||||||
|
} else {
|
||||||
|
b.focused = false
|
||||||
}
|
}
|
||||||
c.Add(gtx.Ops)
|
c.Add(gtx.Ops)
|
||||||
for len(b.history) > 0 {
|
for len(b.history) > 0 {
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ func (e *Enum) Layout(gtx layout.Context, k string, content layout.Widget) layou
|
|||||||
disabled := gtx.Queue == nil
|
disabled := gtx.Queue == nil
|
||||||
if !disabled {
|
if !disabled {
|
||||||
key.InputOp{Tag: &state.tag}.Add(gtx.Ops)
|
key.InputOp{Tag: &state.tag}.Add(gtx.Ops)
|
||||||
|
} else if e.focus == k {
|
||||||
|
e.focused = false
|
||||||
}
|
}
|
||||||
semantic.SelectedOp(k == e.Value).Add(gtx.Ops)
|
semantic.SelectedOp(k == e.Value).Add(gtx.Ops)
|
||||||
semantic.DisabledOp(disabled).Add(gtx.Ops)
|
semantic.DisabledOp(disabled).Add(gtx.Ops)
|
||||||
|
|||||||
Reference in New Issue
Block a user