mirror of
https://github.com/markqvist/Sideband.git
synced 2025-08-06 13:34:25 -04:00
Updated KivyMD
This commit is contained in:
parent
9cf33ec050
commit
4b619f385d
98 changed files with 6018 additions and 3706 deletions
|
@ -29,7 +29,7 @@ MDScreen
|
|||
md_bg_color: app.theme_cls.primary_color
|
||||
"""
|
||||
|
||||
from kivy.properties import ObjectProperty
|
||||
from kivy.properties import ListProperty, ObjectProperty
|
||||
from kivy.uix.screenmanager import Screen
|
||||
|
||||
from kivymd.uix import MDAdaptiveWidget
|
||||
|
@ -44,20 +44,34 @@ class MDScreen(DeclarativeBehavior, Screen, MDAdaptiveWidget):
|
|||
see in the :class:`~kivy.uix.screenmanager.Screen` class documentation.
|
||||
"""
|
||||
|
||||
hero_to = ObjectProperty()
|
||||
hero_to = ObjectProperty(deprecated=True)
|
||||
"""
|
||||
Must be a :class:`~kivymd.uix.hero.MDHeroTo` class.
|
||||
Must be a :class:`~kivymd.uix.hero.MDHeroTo` class.
|
||||
|
||||
See the documentation of the
|
||||
`MDHeroTo <https://kivymd.readthedocs.io/en/latest/components/hero/>`_
|
||||
widget for more detailed information.
|
||||
|
||||
.. versionchanged:: 1.0.0
|
||||
.. deprecated:: 1.0.0
|
||||
Use attr:`heroes_to` attribute instead.
|
||||
|
||||
:attr:`hero_to` is an :class:`~kivy.properties.ObjectProperty`
|
||||
and defaults to `None`.
|
||||
"""
|
||||
|
||||
def on_hero_to(self, screen, widget) -> None:
|
||||
heroes_to = ListProperty()
|
||||
"""
|
||||
Must be a list of :class:`~kivymd.uix.hero.MDHeroTo` class.
|
||||
|
||||
.. versionadded:: 1.0.0
|
||||
|
||||
:attr:`heroes_to` is an :class:`~kivy.properties.LiatProperty`
|
||||
and defaults to `[]`.
|
||||
"""
|
||||
|
||||
def on_hero_to(self, screen, widget: MDHeroTo) -> None:
|
||||
"""Called when the value of the :attr:`hero_to` attribute changes."""
|
||||
|
||||
if not isinstance(widget, MDHeroTo) or not issubclass(
|
||||
widget.__class__, MDHeroTo
|
||||
):
|
||||
|
@ -65,3 +79,4 @@ class MDScreen(DeclarativeBehavior, Screen, MDAdaptiveWidget):
|
|||
f"The `{widget}` widget must be an `kivymd.uix.hero.MDHeroTo` "
|
||||
f"class or inherited from this class"
|
||||
)
|
||||
self.heroes_to = [widget]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue