2022-07-07 16:16:10 -04:00
|
|
|
"""
|
|
|
|
Components/Widget
|
|
|
|
=================
|
|
|
|
|
|
|
|
:class:`~kivy.uix.widget.Widget` class equivalent. Simplifies working
|
|
|
|
with some widget properties. For example:
|
|
|
|
|
|
|
|
Widget
|
|
|
|
------
|
|
|
|
|
2022-10-02 11:16:59 -04:00
|
|
|
.. code-block:: kv
|
2022-07-07 16:16:10 -04:00
|
|
|
|
|
|
|
Widget:
|
|
|
|
size_hint: .5, None
|
|
|
|
height: self.width
|
|
|
|
|
|
|
|
canvas:
|
|
|
|
Color:
|
|
|
|
rgba: app.theme_cls.primary_color
|
|
|
|
RoundedRectangle:
|
|
|
|
pos: self.pos
|
|
|
|
size: self.size
|
|
|
|
radius: [self.height / 2,]
|
|
|
|
|
|
|
|
MDWidget
|
|
|
|
--------
|
|
|
|
|
2022-10-02 11:16:59 -04:00
|
|
|
.. code-block:: kv
|
2022-07-07 16:16:10 -04:00
|
|
|
|
|
|
|
MDWidget:
|
|
|
|
size_hint: .5, None
|
|
|
|
height: self.width
|
|
|
|
radius: self.height / 2
|
|
|
|
md_bg_color: app.theme_cls.primary_color
|
|
|
|
"""
|
|
|
|
|
2022-10-02 11:16:59 -04:00
|
|
|
__all__ = ("MDWidget",)
|
|
|
|
|
2022-10-08 11:17:59 -04:00
|
|
|
from kivy.uix.widget import Widget
|
|
|
|
|
2022-07-07 16:16:10 -04:00
|
|
|
from kivymd.uix import MDAdaptiveWidget
|
2022-10-02 11:16:59 -04:00
|
|
|
from kivymd.uix.behaviors import DeclarativeBehavior
|
2022-07-07 16:16:10 -04:00
|
|
|
|
|
|
|
|
2022-10-08 11:17:59 -04:00
|
|
|
class MDWidget(DeclarativeBehavior, MDAdaptiveWidget, Widget):
|
2022-07-07 16:16:10 -04:00
|
|
|
"""
|
|
|
|
See :class:`~kivy.uix.Widget` class documentation for more information.
|
|
|
|
|
|
|
|
.. versionadded:: 1.0.0
|
|
|
|
"""
|