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:
Egon Elbre
2020-12-12 13:21:06 +02:00
committed by Elias Naur
parent 8e7066ecd7
commit 296303210f
2 changed files with 36 additions and 18 deletions
+6
View File
@@ -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
}