Selection¶
morphui.uix.selection
¶
MorphCheckbox(**kwargs)
¶
Bases: MorphRippleBehavior, MorphToggleButtonBehavior, MorphScaleBehavior, MorphIconLabel
on_active(instance, active)
¶
Handle the active property change.
Triggers the check animations and updates the icon based on
the new state. The active property is inherited from
MorphToggleButtonBehavior.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The instance of the widget where the property changed.
TYPE:
|
active
|
The new value of the
TYPE:
|
MorphRadioButton(**kwargs)
¶
Bases: MorphCheckbox
A radio button widget that allows selection within a group.
This widget extends the MorphCheckbox to provide radio button functionality, where only one button in a group can be active at a time.
Inherits from
:class:~morphui.uix.selection.MorphCheckbox
ThumbSwitch(**kwargs)
¶
Bases: MorphIconLabel
The thumb icon for the MorphSwitch widget.
This class represents the thumb component of a switch, which moves between 'on' and 'off' positions when the switch is toggled.
active = BooleanProperty(False)
class-attribute
instance-attribute
¶
Indicates whether the thumb switch is in the 'active' state.
:attr:active is a :class:~kivy.properties.BooleanProperty and
defaults to False.
MorphSwitch(kw_thumb={}, **kwargs)
¶
Bases: MorphIconBehavior, MorphIdentificationBehavior, MorphRoundSidesBehavior, MorphToggleButtonBehavior, MorphColorThemeBehavior, MorphHoverBehavior, MorphContentLayerBehavior, MorphInteractionLayerBehavior, MorphSurfaceLayerBehavior, FloatLayout
A switch widget that allows toggling between 'on' and 'off' states.
active_icon = StringProperty('check')
class-attribute
instance-attribute
¶
Icon name for the 'active' state of the switch thumb.
The icon is displayed on the thumb when the switch is in the 'active' state (i.e., switched on). The icon name should correspond to a valid icon in the Material Design Icons library.
:attr:active_icon is a :class:~kivy.properties.StringProperty and
defaults to "checkbox-marked-circle".
normal_icon = StringProperty('')
class-attribute
instance-attribute
¶
Icon name for the 'normal' state of the switch thumb.
The icon is displayed on the thumb when the switch is in the
'normal' state (i.e., switched off). The icon name should correspond
to a valid icon in the Material Design Icons library. If no icon is
specified, no icon will be shown in the 'normal' state and the
thumb will be smaller. A common choice for a switch in the 'off'
state is "close".
:attr:normal_icon is a :class:~kivy.properties.StringProperty and
defaults to "checkbox-blank-circle".
minimum_padding = NumericProperty(dp(4))
class-attribute
instance-attribute
¶
The minimum padding around the switch thumb.
This property defines the minimum padding applied to the switch thumb, ensuring that it has enough space to be visually distinct and not overlap with the switch's edges.
:attr:minimum_padding is a
:class:~kivy.properties.NumericProperty and defaults to dp(2).
switch_animation_duration = NumericProperty(0.15)
class-attribute
instance-attribute
¶
Duration of the switch toggle animation in seconds.
Specifies the duration of the animation that plays when the switch is toggled between the 'on' and 'off' states.
:attr:switch_animation_duration is a
:class:~kivy.properties.NumberProperty and defaults to 0.15.
switch_animation_transition = StringProperty('out_sine')
class-attribute
instance-attribute
¶
Transition type for the switch toggle animation.
:attr:switch_animation_transition is a
:class:~kivy.properties.StringProperty and defaults to 'out_sine'.
default_config = dict(theme_color_bindings=(dict(normal_surface_color='surface_dim_color', active_surface_color='primary_color', normal_border_color='outline_color', active_border_color='primary_color')), round_sides=True, size_hint=(None, None), width=(dp(39)), height=(dp(24)))
class-attribute
instance-attribute
¶
Default configuration for the MorphSwitch widget.