Slider#
See also Sliders allow users to make selections from a range of values.
API - kivymd.uix.slider.slider
#
- class kivymd.uix.slider.slider.MDSlider(**kwargs)#
Class for creating a Slider widget. See in the
Slider
class documentation.- active#
If the slider is clicked.
active
is anBooleanProperty
and defaults to False.
- color#
Color slider.
MDSlider color: "red"
color
is anColorProperty
and defaults to None.
- hint#
If True, then the current value is displayed above the slider.
MDSlider hint: True
hint
is anBooleanProperty
and defaults to True.
- hint_bg_color#
Hint rectangle color in (r.g.b.a) format.
MDSlider hint: True hint_bg_color: "red"
hint_bg_color
is anColorProperty
and defaults to [0, 0, 0, 0].
- hint_text_color#
Hint text color in (r.g.b.a) format.
MDSlider hint: True hint_bg_color: "red" hint_text_color: "white"
hint_text_color
is anColorProperty
and defaults to None.
- hint_radius#
Hint radius.
MDSlider hint: True hint_bg_color: "red" hint_text_color: "white" hint_radius: [6, 0, 6, 0]
hint_radius
is anVariableListProperty
and defaults to [dp(4), dp(4), dp(4), dp(4)].
- thumb_color_active#
The color of the thumb when the slider is active.
New in version 1.0.0.
MDSlider thumb_color_active: "red"
thumb_color_active
is anColorProperty
and default to None.
- thumb_color_inactive#
The color of the thumb when the slider is inactive.
New in version 1.0.0.
MDSlider thumb_color_inactive: "red"
thumb_color_inactive
is anColorProperty
and default to None.
- thumb_color_disabled#
The color of the thumb when the slider is in the disabled state.
New in version 1.0.0.
MDSlider value: 55 disabled: True thumb_color_disabled: "red"
thumb_color_disabled
is anColorProperty
and default to None.
- track_color_active#
The color of the track when the slider is active.
New in version 1.0.0.
MDSlider track_color_active: "red"
track_color_active
is anColorProperty
and default to None.
- track_color_inactive#
The color of the track when the slider is inactive.
New in version 1.0.0.
MDSlider track_color_inactive: "red"
track_color_inactive
is anColorProperty
and default to None.
- track_color_disabled#
The color of the track when the slider is in the disabled state.
New in version 1.0.0.
MDSlider disabled: True track_color_disabled: "red"
track_color_disabled
is anColorProperty
and default to None.
- show_off#
Show the ‘off’ ring when set to minimum value.
show_off
is anBooleanProperty
and defaults to True.
- set_thumb_icon(self, *args)#
- on_hint(self, instance, value)#
- on_value_normalized(self, *args)#
When the
value == min
set it to ‘off’ state and make slider a ring.
- on_show_off(self, *args)#
- on__is_off(self, *args)#
- on_active(self, *args)#
- on_touch_down(self, touch)#
Receive a touch down event.
- Parameters:
- touch:
MotionEvent
class Touch received. The touch is in parent coordinates. See
relativelayout
for a discussion on coordinate systems.
- touch:
- Returns:
bool If True, the dispatching of the touch event will stop. If False, the event will continue to be dispatched to the rest of the widget tree.
- on_touch_up(self, touch)#
Receive a touch up event. The touch is in parent coordinates.
See
on_touch_down()
for more information.