Divider¶
morphui.uix.divider
¶
MorphDivider(**kwargs)
¶
Bases: MorphColorThemeBehavior, MorphSurfaceLayerBehavior, Widget
A divider widget that visually separates content areas.
This class combines the functionality of Kivy's Widget with
several MorphUI behaviors to enhance its capabilities:
- MorphColorThemeBehavior: Integrates color theming capabilities.
- MorphSurfaceLayerBehavior: Provides surface styling options.
Examples:
from morphui.app import MorphApp
from morphui.uix.boxlayout import MorphBoxLayout
from morphui.uix.divider import MorphDivider
from morphui.uix.label import MorphLabel
class MyApp(MorphApp):
def build(self) -> MorphBoxLayout:
self.theme_manager.seed_color = 'Purple'
return MorphBoxLayout(
MorphLabel(
text="Above the Divider",
theme_style='primary'),
MorphDivider(
orientation='horizontal',
thickness=1,),
MorphLabel(
text="Below the Divider",
theme_style='secondary',
auto_size=True,),
orientation='vertical',
spacing=15,
padding=50,)
MyApp().run()
orientation = StringProperty('horizontal', options=('horizontal', 'vertical'))
class-attribute
instance-attribute
¶
Orientation of the divider, either 'horizontal' or 'vertical'.
This property determines the layout direction of the divider.
:attr:orientation is a
:class:~kivy.properties.StringProperty and defaults to
'horizontal'.
thickness = NumericProperty(1.0)
class-attribute
instance-attribute
¶
Thickness of the divider line in pixels.
:attr:thickness is a :class:~kivy.properties.NumericProperty and
defaults to 1.0.
default_config = dict(theme_color_bindings=(dict(normal_surface_color='outline_color')))
class-attribute
instance-attribute
¶
Default configuration values for MorphDivider.
Provides standard appearance and behavior settings:
- theme_color_bindings: Maps the surface_color to the
outline_color from the theme for consistent styling.