test-kivy-app/kivy_venv/lib/python3.11/site-packages/kivymd/uix/widget.py

66 lines
1.4 KiB
Python
Raw Normal View History

2024-09-15 12:12:16 +00:00
"""
Components/Widget
=================
:class:`~kivy.uix.widget.Widget` class equivalent. Simplifies working
with some widget properties. For example:
Widget
------
.. code-block:: kv
Widget:
size_hint: .5, None
height: self.width
canvas:
Color:
2024-09-15 17:57:02 +00:00
rgba: app.theme_cls.primaryColor
2024-09-15 12:12:16 +00:00
RoundedRectangle:
pos: self.pos
size: self.size
radius: [self.height / 2,]
MDWidget
--------
.. code-block:: kv
MDWidget:
size_hint: .5, None
height: self.width
radius: self.height / 2
2024-09-15 17:57:02 +00:00
md_bg_color: app.theme_cls.primaryColor
2024-09-15 12:12:16 +00:00
"""
__all__ = ("MDWidget",)
from kivy.uix.widget import Widget
from kivymd.theming import ThemableBehavior
from kivymd.uix import MDAdaptiveWidget
2024-09-15 17:57:02 +00:00
from kivymd.uix.behaviors import DeclarativeBehavior, BackgroundColorBehavior
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
class MDWidget(
DeclarativeBehavior,
ThemableBehavior,
BackgroundColorBehavior,
MDAdaptiveWidget,
Widget,
):
2024-09-15 12:12:16 +00:00
"""
2024-09-15 17:57:02 +00:00
Widget class.
For more information, see in the
:class:`~kivymd.uix.behaviors.declarative_behavior.DeclarativeBehavior` and
:class:`~kivymd.theming.ThemableBehavior` and
:class:`~kivymd.uix.behaviors.backgroundcolor_behavior.BackgroundColorBehavior` and
:class:`~kivymd.uix.MDAdaptiveWidget` and
:class:`~kivy.uix.widget.Widget` and
classes documentation.
2024-09-15 12:12:16 +00:00
.. versionadded:: 1.0.0
"""