mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
widget/material: Make checkbox/radio buttons icon modifiable
Signed-off-by: songpv <pvsong10@icloud.com>
This commit is contained in:
@@ -22,11 +22,13 @@ type Theme struct {
|
||||
Hint color.RGBA
|
||||
InvText color.RGBA
|
||||
}
|
||||
TextSize unit.Value
|
||||
checkBoxCheckedIcon *widget.Icon
|
||||
checkBoxUncheckedIcon *widget.Icon
|
||||
radioCheckedIcon *widget.Icon
|
||||
radioUncheckedIcon *widget.Icon
|
||||
TextSize unit.Value
|
||||
Icon struct {
|
||||
CheckBoxChecked *widget.Icon
|
||||
CheckBoxUnchecked *widget.Icon
|
||||
RadioChecked *widget.Icon
|
||||
RadioUnchecked *widget.Icon
|
||||
}
|
||||
}
|
||||
|
||||
func NewTheme(fontCollection []text.FontFace) *Theme {
|
||||
@@ -39,10 +41,10 @@ func NewTheme(fontCollection []text.FontFace) *Theme {
|
||||
t.Color.InvText = rgb(0xffffff)
|
||||
t.TextSize = unit.Sp(16)
|
||||
|
||||
t.checkBoxCheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBox))
|
||||
t.checkBoxUncheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank))
|
||||
t.radioCheckedIcon = mustIcon(widget.NewIcon(icons.ToggleRadioButtonChecked))
|
||||
t.radioUncheckedIcon = mustIcon(widget.NewIcon(icons.ToggleRadioButtonUnchecked))
|
||||
t.Icon.CheckBoxChecked = mustIcon(widget.NewIcon(icons.ToggleCheckBox))
|
||||
t.Icon.CheckBoxUnchecked = mustIcon(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank))
|
||||
t.Icon.RadioChecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonChecked))
|
||||
t.Icon.RadioUnchecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonUnchecked))
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user