Skip to content

Float Layout

morphui.uix.floatlayout

MorphFloatLayout(*widgets, **kwargs)

Bases: MorphDeclarativeBehavior, MorphColorThemeBehavior, MorphSurfaceLayerBehavior, MorphElevationBehavior, FloatLayout

A FloatLayout that supports declarative child widgets via :class:~morphui.uix.behaviors.MorphDeclarativeBehavior.

This class combines the functionality of Kivy's FloatLayout with several MorphUI behaviors to enhance its capabilities: - MorphDeclarativeBehavior: Enables declarative property binding. - MorphColorThemeBehavior: Integrates color theming capabilities. - MorphSurfaceLayerBehavior: Provides surface styling options.

Examples:

from morphui.app import MorphApp
from morphui.uix.label import MorphLabel
from morphui.uix.floatlayout import MorphFloatLayout

class MyApp(MorphApp):
    def build(self) -> MorphFloatLayout:
        self.theme_manager.seed_color = 'Purple'
        return MorphFloatLayout(
            MorphLabel(
                text="Label 1",
                theme_style='primary'),
            MorphLabel(
                text="Label 2",
                theme_style='secondary',
                auto_size=True,),
            theme_style='surface',)

MyApp().run()

default_config = dict() class-attribute instance-attribute

Default configuration for the MorphFloatLayout.