mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-23 15:34:52 -04:00
refactor(tracker/gioui): rewrote Button(s) to bind to Model during layout
The old mechanism made it difficult to follow exactly what happens when a button was clicked, because the Action/Bool that gets executed / toggled was declared ages ago, in the constructor. In the new mechanism, the Action / Bool is bound to the button at the last minute, right before Layout. ActionButton, ToggleButton, ActionIconButton and ToggleIconButton were done to avoid heap escapes: if the corresponding functions woudl've returned layout.Widget, a heap allocation would've been needed.
This commit is contained in:
parent
0ea20ea5bf
commit
db2ccf977d
@ -54,6 +54,24 @@ button:
|
||||
cornerradius: 0
|
||||
height: *buttonheight
|
||||
inset: *buttoninset
|
||||
iconbutton:
|
||||
enabled:
|
||||
color: *primarycolor
|
||||
size: 24
|
||||
inset: { top: 6, bottom: 6, left: 6, right: 6 }
|
||||
disabled:
|
||||
color: *disabled
|
||||
size: 24
|
||||
inset: { top: 6, bottom: 6, left: 6, right: 6 }
|
||||
emphasis:
|
||||
color: *contrastfg
|
||||
background: *primarycolor
|
||||
size: 24
|
||||
inset: { top: 6, bottom: 6, left: 6, right: 6 }
|
||||
error:
|
||||
color: *errorcolor
|
||||
size: 24
|
||||
inset: { top: 6, bottom: 6, left: 6, right: 6 }
|
||||
oscilloscope:
|
||||
curvecolors: [*primarycolor, *secondarycolor]
|
||||
limitcolor: { r: 255, g: 255, b: 255, a: 8 }
|
||||
|
Reference in New Issue
Block a user