Scroll Widgets¶
Implements Different classes to display elements in a scroll view.
ScrollList and LeftStatusIndicatorListItem.
-
class
acg.custom_widgets.scroll_widgets.CallbackBehavior[source]¶ Bases:
kivy.event.EventDispatcherMixin Class to implement a number of callbacks.
Useful e.g. in combination with
RecycleView. There, the content is generated dynamically from a dictionary such that this class can be used to bind multiple callbacks to different events of the widgets.Warning
Callbacks are not unbound by
on_callbacks(). Does this pose a problem?-
callback_wrapper(self, callback, *_)¶ Call
callbackwith first argument asselfin new thread.
-
callbacks¶ callback_fn}. callback_fn(self) -> Any
Type: DictPropertyof the form {“on_event”
-
on_callbacks(self, *_)¶ Binds the callbacks to the specified events on definition.
-
-
class
acg.custom_widgets.scroll_widgets.ChildrenFromDataBehavior(**kwargs)[source]¶ Generates widgets dynamically from
dataand adds them toroot_for_children.Bindings can be applied and other functions executed by the definition of
before_add_child()andafter_add_child().-
add_child(self, child_dict=None)¶ Add one child-widget.
-
after_add_child(self, child)¶ Do something after child is added to
parent_widget. Placeholder.
-
before_add_child(self, child)¶ Do something before child is added to
parent_widget. Placeholder.
-
child_bindings¶ binding_fn}.
Type: DictPropertyof the form {“on_event”
-
child_class_name¶ StringPropertyclass name for children. Needs to be available viaget().
-
data¶ ListPropertycontaining the dictionaries from which the child-widgets are constructed.
-
get_child(self, name)¶ Return child with name
name.
-
remove_child(self)¶ Remove one child-widget.
-
root_for_children¶ ObjectPropertythe widget, where the children should be added to Defaults to self.
-
update_num_children(self)¶ Add/remove children until correct number is reached.
-
-
class
acg.custom_widgets.scroll_widgets.LeftStatusIndicator(**kwargs)[source]¶ Bases:
acg.custom_widgets.behaviors.MultiStateBehavior,kivymd.uix.list.ILeftBody,kivy.uix.anchorlayout.AnchorLayoutContains
MDSpinnerandMDIcon.-
spinner_active[source]¶ ObjectPropertyset toMDSpinner.
-
-
class
acg.custom_widgets.scroll_widgets.LeftStatusIndicatorListItem[source]¶ Bases:
acg.custom_widgets.behaviors.CallbackBehavior,kivymd.uix.list.OneLineAvatarListItemContains
LeftStatusIndicatoras left element.Depending on
current_state, either the spinner is active or an icon is shown.-
current_state[source]¶ OptionPropertywith options["loading", "queued", "waiting", "ready", "done", "error", "exported"].
-
-
class
acg.custom_widgets.scroll_widgets.MultiStateBehavior(**kwargs)[source]¶ Bases:
kivy.uix.widget.WidgetChanges properties of widget based on
current_stateand the corresponding entry instate_dict.The properties in
animated_propertieschange via animation.-
animated_properties¶ ListPropertycontaining the list of property-names that get changed via animation.
-
state_dicts¶ DictProperty. E.g.,state_dicts = { state_1 : {"some_property": some_value, ...}, ... }
-
update_properties(self, *_)¶ Update properties if they differ from the corresponding entry in
current_properties.
-
-
class
acg.custom_widgets.scroll_widgets.RecycleList(**kwargs)[source]¶ Bases:
kivy.uix.recycleview.RecycleViewRecycleViewobject containing aRecycleViewBoxLayout.
-
class
acg.custom_widgets.scroll_widgets.RecycleViewBox(**kwargs)[source]¶ Bases:
kivy.uix.recycleview.RecycleViewRecycleViewobject containing aRecycleViewBoxLayout.
-
class
acg.custom_widgets.scroll_widgets.ScrollBox(**kwargs)[source]¶ Bases:
acg.custom_widgets.behaviors.ChildrenFromDataBehavior,kivy.uix.scrollview.ScrollViewScrollViewcontaining aBoxLayout.Children are constructed from
child_dictand added to the BoxLayout.
-
class
acg.custom_widgets.scroll_widgets.ScrollGrid(**kwargs)[source]¶ Bases:
acg.custom_widgets.behaviors.ChildrenFromDataBehavior,kivy.uix.scrollview.ScrollViewScrollViewcontaining aGridLayout.Children are constructed from
child_dictand added to the BoxLayout.
-
class
acg.custom_widgets.scroll_widgets.ScrollList(**kwargs)[source]¶ Bases:
acg.custom_widgets.behaviors.ChildrenFromDataBehavior,kivy.uix.scrollview.ScrollViewScrollable List whose items are constructed as instances of
item_typefromitem_dicts.Automatically updates upon change of
item_dicts.-
data[source]¶ ListPropertycontaining the dictionaries from which the items are constructed.
-
list[source]¶ ObjectPropertyset toMDList. Contains the items.
-