Skip to content

Index

morphui.uix.dataview.index

MorphDataViewIndexLabel(**kwargs)

Bases: BaseDataViewLabel

A label widget designed for use as an index label in a data view.

This class extends the base data view label to provide specific styling and behavior for index labels.

default_config = dict(theme_color_bindings=(dict(normal_content_color='content_surface_color', normal_overlay_edge_color='outline_color')), typography_role='Label', typography_size='medium', typography_weight='Regular', halign='right', valign='center', padding=[dp(8), dp(4)], overlay_edge_width=(dp(0.5)), size_hint=(1, None), auto_size=(False, False), height=(dp(30)), text_size=(dp(85) - dp(16), dp(30) - dp(8)), visible_edges=['right', 'bottom']) class-attribute instance-attribute

Default configuration for the MorphDataViewIndexLabel.

MorphDataViewIndexLayout(**kwargs)

Bases: MorphRecycleBoxLayout

A layout for arranging index labels in a data view.

This class extends the base data view layout and MorphRecycleBoxLayout to provide a vertical layout suitable for index labels.

default_config = dict(theme_color_bindings={'normal_surface_color': 'surface_container_high_color'}, orientation='vertical', auto_size=(False, True), size_hint_x=None, width=(dp(85))) class-attribute instance-attribute

Default configuration for the MorphDataViewHeaderLayout.

MorphDataViewIndex(**kwargs)

Bases: BaseDataView

A scrollable index for data views, synchronized with the main data view.

This class provides an index component for data views that can scroll vertically in sync with the associated data view. It uses a custom layout manager to arrange index labels and supports dynamic row naming.

Example
from morphui.app import MorphApp
from morphui.uix.dataview.index import MorphDataViewIndex

class MyApp(MorphApp):
    def build(self) -> MorphDataViewIndex:
        self.theme_manager.theme_mode = 'Dark'
        self.theme_manager.seed_color = 'morphui_teal'
        index = MorphDataViewIndex()
        index.row_names = [f'Row {i}' for i in range(1, 51)]
        return index
MyApp().run()

row_names = AliasProperty(_get_row_names, _set_row_names, bind=['data']) class-attribute instance-attribute

List of row names displayed in the index.

This property allows getting and setting the row names for the index. When set, it updates the index's data accordingly.

:attr:row_names is an :class:~kivy.properties.AliasProperty and is bound to changes in the data property.

default_config = dict(do_scroll_x=False, do_scroll_y=True, size_hint=(None, 1), bar_width=0) class-attribute instance-attribute

Default configuration for the :class:MorphDataViewIndex.

on_rows_updated(*args)

Event handler called when the rows are updated.

This event is dispatched whenever the row names are changed, allowing for custom behavior to be implemented in response to row updates.