test-kivy-app/kivy_venv/lib/python3.11/site-packages/kivymd/uix/navigationrail/navigationrail.kv

110 lines
2.9 KiB
Plaintext
Raw Normal View History

2024-09-15 12:12:16 +00:00
<MDNavigationRailMenuButton>
2024-09-15 17:57:02 +00:00
pos_hint: {"center_x": .5}
theme_icon_color: "Custom"
icon_color: self.theme_cls.onSurfaceVariantColor
2024-09-15 12:12:16 +00:00
<MDNavigationRailFabButton>
type: "standard"
pos_hint: {"center_x": .5}
2024-09-15 17:57:02 +00:00
theme_bg_color: "Custom"
md_bg_color: self.theme_cls.primaryColor
theme_icon_color: "Custom"
icon_color: self.theme_cls.onPrimaryColor
2024-09-15 12:12:16 +00:00
<MDNavigationRailItem>
orientation: "vertical"
size_hint: None, None
2024-09-15 17:57:02 +00:00
width: "80dp"
height: self.minimum_height
spacing:
( \
{ \
"selected": "8dp", \
"labeled": "16dp", \
"unselected": "16dp", \
}[self._navigation_rail.type] \
) \
if self._navigation_rail else 0
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
<MDNavigationRailItemIcon>
canvas.before:
Color:
rgba:
( \
2024-09-15 12:12:16 +00:00
( \
2024-09-15 17:57:02 +00:00
self.theme_cls.secondaryContainerColor \
if not self.active_indicator_color else \
self.active_indicator_color \
)[:-1] + [self._alpha] \
2024-09-15 12:12:16 +00:00
) \
2024-09-15 17:57:02 +00:00
if self._layer_color == self.theme_cls.transparentColor else \
self._layer_color
RoundedRectangle:
group: "navigation-rail-rounded-rectangle"
radius:
2024-09-15 12:12:16 +00:00
( \
2024-09-15 17:57:02 +00:00
[ \
2024-09-15 12:12:16 +00:00
( \
2024-09-15 17:57:02 +00:00
dp(16) \
if self._navigation_rail.type != "unselected" else \
dp(28) \
), \
] \
) \
if self._navigation_rail else [0, ]
pos:
self.center_x - self._selected_region_width / 2, \
2024-09-15 12:12:16 +00:00
( \
2024-09-15 17:57:02 +00:00
self.y \
- ( \
dp(4) \
if self._navigation_rail.type != "unselected" else \
dp(16) \
2024-09-15 12:12:16 +00:00
) \
2024-09-15 17:57:02 +00:00
) \
if self._navigation_rail else 0
size:
self._selected_region_width, \
2024-09-15 12:12:16 +00:00
( \
2024-09-15 17:57:02 +00:00
self.height \
+ ( \
dp(8) \
if self._navigation_rail.type != "unselected" else \
self.width + dp(8)\
) \
) \
if self._navigation_rail else 0
pos_hint: {"center_x": .5}
<MDNavigationRailItemLabel>
size_hint_y: None
height: 0
halign: "center"
text_color: self.theme_cls.onSurfaceVariantColor
font_style: "Label"
role: "medium"
<MDNavigationRail>
size_hint: None, 1
width: "80dp"
md_bg_color: self.theme_cls.surfaceColor
BoxLayout:
id: box_items
orientation: "vertical"
size_hint: None, None
size: self.minimum_size
pos_hint: {"center_x": .5}
spacing:
{ \
"selected": "12dp", \
"labeled": "24dp", \
"unselected": "36dp", \
}[root.type]