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

84 lines
2.0 KiB
Plaintext
Raw Normal View History

2024-09-15 12:12:16 +00:00
#:import Window kivy.core.window.Window
2024-09-15 17:57:02 +00:00
<MDNavigationDrawer>
type: "filled"
2024-09-15 12:12:16 +00:00
size_hint_x: None
2024-09-15 17:57:02 +00:00
width: Window.width - dp(56) if Window.width <= dp(360) else dp(320)
theme_bg_color: "Custom"
shadow_radius: self.radius
md_bg_color:
self.theme_cls.surfaceContainerLowColor \
if not self.background_color else \
self.background_color
2024-09-15 12:12:16 +00:00
x:
(self.width * (self.open_progress - 1)) \
if self.anchor == "left" \
else (Window.width - self.width * self.open_progress)
<MDNavigationDrawerLabel>
adaptive_height: True
2024-09-15 17:57:02 +00:00
padding: "20dp", "0dp", "16dp", "16dp"
text_color:
self.theme_cls.onSurfaceColor \
if self.theme_text_color == "Primary" else \
self.text_color
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
<MDNavigationDrawerItem>
radius: self.height / 2
ripple_color: self.theme_cls.onSecondaryContainerColor[:-1] + [0.12]
theme_bg_color: "Custom"
md_bg_color:
self.theme_cls.surfaceContainerLowColor \
if not self.inactive_indicator_color else \
self.inactive_indicator_color
<MDNavigationDrawerItemTrailingText>
text_color:
self.theme_cls.onSurfaceVariantColor \
if self.theme_text_color == "Primary" else \
self.text_color
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
<MDNavigationDrawerItemText>
font_style: "Label"
role: "large"
text_color:
self.theme_cls.onSurfaceVariantColor \
if self.theme_text_color == "Primary" else \
self.text_color
<MDNavigationDrawerItemLeadingIcon>
icon_color:
self.theme_cls.onSurfaceVariantColor \
if self.theme_icon_color == "Primary" else \
self.icon_color
2024-09-15 12:12:16 +00:00
<MDNavigationDrawerHeader>
2024-09-15 17:57:02 +00:00
size_hint_y: None
height: self.minimum_height
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
<MDNavigationDrawerDivider>
padding: 0, "4dp", 0, "4dp"
size_hint_y: None
height: self.minimum_height
2024-09-15 12:12:16 +00:00
2024-09-15 17:57:02 +00:00
MDDivider:
2024-09-15 12:12:16 +00:00
<MDNavigationDrawerMenu>
2024-09-15 17:57:02 +00:00
GridLayout:
2024-09-15 12:12:16 +00:00
id: menu
2024-09-15 17:57:02 +00:00
cols: 1
size_hint_y: None
height: self.minimum_height
2024-09-15 12:12:16 +00:00
spacing: root.spacing
2024-09-15 17:57:02 +00:00