mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
widget/material: [API] add description argument to Switch constructor
Switch needs a semantic description, but doesn't have a text label attached. This change adds a description argument to the constructor. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -17,7 +17,8 @@ import (
|
||||
)
|
||||
|
||||
type SwitchStyle struct {
|
||||
Color struct {
|
||||
Description string
|
||||
Color struct {
|
||||
Enabled color.NRGBA
|
||||
Disabled color.NRGBA
|
||||
Track color.NRGBA
|
||||
@@ -26,9 +27,10 @@ type SwitchStyle struct {
|
||||
}
|
||||
|
||||
// Switch is for selecting a boolean value.
|
||||
func Switch(th *Theme, swtch *widget.Bool) SwitchStyle {
|
||||
func Switch(th *Theme, swtch *widget.Bool, description string) SwitchStyle {
|
||||
sw := SwitchStyle{
|
||||
Switch: swtch,
|
||||
Switch: swtch,
|
||||
Description: description,
|
||||
}
|
||||
sw.Color.Enabled = th.Palette.ContrastBg
|
||||
sw.Color.Disabled = th.Palette.Bg
|
||||
|
||||
Reference in New Issue
Block a user