mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
widget/material: updated Switch comments.
Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ type SwitchStyle struct {
|
|||||||
Switch *widget.Bool
|
Switch *widget.Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Switch is for selecting a boolean value.
|
||||||
func Switch(th *Theme, swtch *widget.Bool) SwitchStyle {
|
func Switch(th *Theme, swtch *widget.Bool) SwitchStyle {
|
||||||
sw := SwitchStyle{
|
sw := SwitchStyle{
|
||||||
Switch: swtch,
|
Switch: swtch,
|
||||||
@@ -36,7 +37,7 @@ func Switch(th *Theme, swtch *widget.Bool) SwitchStyle {
|
|||||||
return sw
|
return sw
|
||||||
}
|
}
|
||||||
|
|
||||||
// Layout updates the checkBox and displays it.
|
// Layout updates the switch and displays it.
|
||||||
func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
|
func (s SwitchStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||||
trackWidth := gtx.Px(unit.Dp(36))
|
trackWidth := gtx.Px(unit.Dp(36))
|
||||||
trackHeight := gtx.Px(unit.Dp(16))
|
trackHeight := gtx.Px(unit.Dp(16))
|
||||||
|
|||||||
Reference in New Issue
Block a user