mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-22 23:14:59 -04:00
refactor(tracker): Make Action have separate Doer and Enabler
This commit is contained in:
parent
d6badb97be
commit
036cb1f34d
@ -69,7 +69,7 @@ func ActionIcon(gtx C, th *Theme, w *ActionClickable, icon []byte, tip string) T
|
||||
for w.Clickable.Clicked(gtx) {
|
||||
w.Action.Do()
|
||||
}
|
||||
if !w.Action.Allowed() {
|
||||
if !w.Action.Enabled() {
|
||||
ret.IconButtonStyle.Color = th.Button.Disabled.Color
|
||||
}
|
||||
return ret
|
||||
@ -119,7 +119,7 @@ func ActionButton(gtx C, th *Theme, style *ButtonStyle, w *ActionClickable, text
|
||||
for w.Clickable.Clicked(gtx) {
|
||||
w.Action.Do()
|
||||
}
|
||||
if !w.Action.Allowed() {
|
||||
if !w.Action.Enabled() {
|
||||
return Btn(th, &th.Button.Disabled, &w.Clickable, text)
|
||||
}
|
||||
return Btn(th, style, &w.Clickable, text)
|
||||
|
Reference in New Issue
Block a user