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

116 lines
2.0 KiB
Python
Raw Normal View History

2024-09-15 12:12:16 +00:00
"""
Components/BoxLayout
====================
:class:`~kivy.uix.boxlayout.BoxLayout` class equivalent. Simplifies working
with some widget properties. For example:
BoxLayout
---------
.. code-block:: kv
BoxLayout:
size_hint_y: None
height: self.minimum_height
canvas:
Color:
2024-09-15 17:57:02 +00:00
rgba: app.theme_cls.primaryColor
2024-09-15 12:12:16 +00:00
Rectangle:
pos: self.pos
size: self.size
MDBoxLayout
-----------
.. code-block:: kv
MDBoxLayout:
adaptive_height: True
2024-09-15 17:57:02 +00:00
md_bg_color: app.theme_cls.primaryColor
2024-09-15 12:12:16 +00:00
Available options are:
----------------------
- adaptive_height_
- adaptive_width_
- adaptive_size_
.. adaptive_height:
2024-09-15 17:57:02 +00:00
2024-09-15 12:12:16 +00:00
adaptive_height
---------------
.. code-block:: kv
adaptive_height: True
Equivalent
.. code-block:: kv
size_hint_y: None
height: self.minimum_height
.. adaptive_width:
2024-09-15 17:57:02 +00:00
2024-09-15 12:12:16 +00:00
adaptive_width
--------------
.. code-block:: kv
adaptive_width: True
Equivalent
.. code-block:: kv
size_hint_x: None
height: self.minimum_width
.. adaptive_size:
2024-09-15 17:57:02 +00:00
2024-09-15 12:12:16 +00:00
adaptive_size
-------------
.. code-block:: kv
adaptive_size: True
Equivalent
.. code-block:: kv
size_hint: None, None
size: self.minimum_size
"""
__all__ = ("MDBoxLayout",)
from kivy.uix.boxlayout import BoxLayout
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
class MDBoxLayout(
2024-09-15 17:57:02 +00:00
DeclarativeBehavior,
ThemableBehavior,
BackgroundColorBehavior,
BoxLayout,
MDAdaptiveWidget,
2024-09-15 12:12:16 +00:00
):
"""
Box layout class.
2024-09-15 17:57:02 +00:00
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:`~kivy.uix.boxlayout.BoxLayout` and
:class:`~kivymd.uix.MDAdaptiveWidget`
classes documentation.
2024-09-15 12:12:16 +00:00
"""