mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +00:00
widget,widget/material: export Enum.Value
The Value method both updated the enum value and returned it. In order to access the current value withoutm, expose the Value field of the enum and rename the method to Update. As a bonus we can get rid of the SetValue method as well. Updates gio#96 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -32,7 +32,9 @@ func RadioButton(th *Theme, key, label string) RadioButtonStyle {
|
||||
}
|
||||
}
|
||||
|
||||
// Layout updates enum and displays the radio button.
|
||||
func (r RadioButtonStyle) Layout(gtx *layout.Context, enum *widget.Enum) {
|
||||
r.layout(gtx, enum.Value(gtx) == r.Key)
|
||||
enum.Update(gtx)
|
||||
r.layout(gtx, enum.Value == r.Key)
|
||||
enum.Layout(gtx, r.Key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user