mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
widget/material: remove padding from Slider
Remove padding from the sides of the Slider to align them with
other components.
However, since sliders still need to be used with fingers try to
enforce a minimum finger height, if there is sufficient room.
The sides don't need similar treatment since after grabbing it's
possible to move the finger beyond the touch area, without losing
interaction.
To not enforce finger size, the theme can be adjusted:
theme.FingerSize = unit.Px(0)
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
@@ -40,6 +40,9 @@ type Theme struct {
|
||||
RadioChecked *widget.Icon
|
||||
RadioUnchecked *widget.Icon
|
||||
}
|
||||
|
||||
// FingerSize is the minimum touch target size.
|
||||
FingerSize unit.Value
|
||||
}
|
||||
|
||||
func NewTheme(fontCollection []text.FontFace) *Theme {
|
||||
@@ -59,6 +62,9 @@ func NewTheme(fontCollection []text.FontFace) *Theme {
|
||||
t.Icon.RadioChecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonChecked))
|
||||
t.Icon.RadioUnchecked = mustIcon(widget.NewIcon(icons.ToggleRadioButtonUnchecked))
|
||||
|
||||
// 38dp is on the lower end of possible finger size.
|
||||
t.FingerSize = unit.Dp(38)
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user