-
Notifications
You must be signed in to change notification settings - Fork 1
/
kmd_navigation_drawer.kv
93 lines (68 loc) · 2.7 KB
/
kmd_navigation_drawer.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#:import environ os.environ
#:import version kivymd.__version__
<KitchenSinkContentNavigationDrawer>
BoxLayout:
orientation: "vertical"
FloatLayout:
size_hint_y: None
height: "200dp"
canvas:
Color:
rgba: app.theme_cls.primary_color
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
id: top_box
size_hint_y: None
height: "200dp"
x: root.parent.x
pos_hint: {"top": 1}
FitImage:
source: f"{environ['KITCHEN_SINK_ASSETS']}kivymd.png"
MDIconButton:
icon: "close"
x: root.parent.x + dp(10)
pos_hint: {"top": 1}
on_release: root.parent.set_state()
MDLabel:
markup: True
text: f"[b]KivyMD[/b]\nVersion: {version}"
x: root.parent.x + dp(10)
y: root.height - top_box.height + dp(10)
size_hint_y: None
height: self.texture_size[1]
ScrollView:
pos_hint: {"top": 1}
MDGridLayout:
id: box_item
cols: 1
adaptive_height: True
<KitchenSinkNavigationDrawer>:
name: "navigation drawer"
NavigationLayout:
ScreenManager:
Screen:
BoxLayout:
orientation: "vertical"
MDToolbar:
title: "Navigation Drawer"
md_bg_color: app.theme_cls.primary_color
elevation: 10
left_action_items: [["menu", lambda x: nav_drawer.set_state("toggle")]]
right_action_items: [["arrow-left", lambda x: app.back_to_home_screen()]]
BoxLayout:
orientation: "vertical"
padding: "16dp"
spacing: "8dp"
MDRaisedButton:
text: "MDNavigationDrawer.type = " + nav_drawer.type
on_release: nav_drawer.type = "standard" if nav_drawer.type == "modal" else "modal"
MDRaisedButton:
text: "MDNavigationDrawer.anchor = " + nav_drawer.anchor
on_release: nav_drawer.anchor = "right" if nav_drawer.anchor == "left" else "left"
Widget:
MDNavigationDrawer:
id: nav_drawer
KitchenSinkContentNavigationDrawer:
id: content_drawer