mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
widgets, widgets/material: add RadioButton & Enum
Signed-off-by: Alexander Arin <fralx@yandex.ru>
This commit is contained in:
committed by
Elias Naur
parent
82e51019e1
commit
089ae31f0c
@@ -62,10 +62,11 @@ var (
|
||||
SingleLine: true,
|
||||
Submit: true,
|
||||
}
|
||||
button = new(widget.Button)
|
||||
greenButton = new(widget.Button)
|
||||
iconButton = new(widget.Button)
|
||||
list = &layout.List{
|
||||
button = new(widget.Button)
|
||||
greenButton = new(widget.Button)
|
||||
iconButton = new(widget.Button)
|
||||
radioButtonsGroup = new(widget.Enum)
|
||||
list = &layout.List{
|
||||
Axis: layout.Vertical,
|
||||
}
|
||||
green = true
|
||||
@@ -125,6 +126,19 @@ func kitchen(gtx *layout.Context, th *material.Theme) {
|
||||
func() {
|
||||
th.CheckBox("Checkbox").Layout(gtx, checkbox)
|
||||
},
|
||||
func() {
|
||||
group := layout.Flex{}
|
||||
r1 := group.Rigid(gtx, func() {
|
||||
th.RadioButton("r1", "RadioButton1").Layout(gtx, radioButtonsGroup)
|
||||
})
|
||||
r2 := group.Rigid(gtx, func() {
|
||||
th.RadioButton("r2", "RadioButton2").Layout(gtx, radioButtonsGroup)
|
||||
})
|
||||
r3 := group.Rigid(gtx, func() {
|
||||
th.RadioButton("r3", "RadioButton3").Layout(gtx, radioButtonsGroup)
|
||||
})
|
||||
group.Layout(gtx, r1, r2, r3)
|
||||
},
|
||||
}
|
||||
list.Layout(gtx, len(widgets), func(i int) {
|
||||
layout.UniformInset(unit.Dp(16)).Layout(gtx, widgets[i])
|
||||
|
||||
Reference in New Issue
Block a user