-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalendar.kv
executable file
·214 lines (202 loc) · 5.44 KB
/
calendar.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#:kivy 1.0
#:import Calendar ui.calendar
#:import Month ui.month
#:import Day ui.day
Calendar:
<Querying>:
id: querying_popup
size_hint_y: None
height: '30dp'
auto_dismiss: False
Label:
text: "Consultando..."
<Confirm>:
id: confirmation_popup
size_hint: [.9,.9]
auto_dismiss: False
ok_button: ok_button
cancel_button: cancel_button
BoxLayout:
orientation: "vertical"
BoxLayout:
orientation: "horizontal"
padding: ['10dp','10dp','10dp','10dp']
Label:
text: root.text
text_size: self.size
valign: 'middle'
halign: 'center'
BoxLayout:
height: '60dp'
size_hint_y: None
padding: ['10dp','10dp','10dp','10dp']
orientation: "horizontal"
Button:
height: '40dp'
size_hint_y: None
id: ok_button
text: "OK"
on_press: root.accept()
Button:
size_hint_y: None
height: '40dp'
id: cancel_button
text: "Cancelar"
on_press: root.cancel()
<Error>:
id: error_popup
size_hint_x: .9
size_hint_y: .5
auto_dismiss: False
ok_button: ok_button
BoxLayout:
height:root.height
orientation: "vertical"
BoxLayout:
orientation: "horizontal"
padding: ['10dp','10dp','10dp','10dp']
Label:
text: root.text
text_size: self.size
valign: 'middle'
halign: 'center'
BoxLayout:
size_hint_y: None
height: '60dp'
padding: ['10dp','10dp','10dp','10dp']
orientation: "horizontal"
Button:
size_hint_y: None
height: '40dp'
id: ok_button
text: "OK"
on_press: root.accept()
<Calendar>:
current_month: current_month
next_month: next_month
service_state: False
toggle_service: toggle_service
status_bar: status_bar
BoxLayout:
orientation: "vertical"
BoxLayout:
orientation: "horizontal"
height: '50dp'
size_hint_y: None
padding: ['5dp','5dp','5dp','0dp']
Widget:
width: '5dp'
size_hint_x: None
Button:
width: '40dp'
size_hint_x: None
on_press: root.open_settings()
Image:
source: 'res/ic_settings_applications_white_48dp.png'
center_y: self.parent.center_y
center_x: self.parent.center_x
size: '30dp', '30dp'
allow_stretch: True
Button:
width: '40dp'
size_hint_x: None
on_press: root.start_modify_request()
Image:
source: 'res/ic_file_upload_white_48dp.png'
center_y: self.parent.center_y
center_x: self.parent.center_x
size: '40dp', '40dp'
allow_stretch: True
Button:
width: '40dp'
size_hint_x: None
on_press: root.refresh_request()
Image:
source: 'res/ic_refresh_white_48dp.png'
center_y: self.parent.center_y
center_x: self.parent.center_x
size: '40dp', '40dp'
allow_stretch: True
Button:
id: toggle_service
width: '40dp'
size_hint_x: None
on_press: root.toggle_service_state()
img_play: img_play
img_stop: img_stop
Image:
id: img_stop
opacity: 0
source: 'res/ic_stop_white_48dp.png'
center_y: self.parent.center_y
center_x: self.parent.center_x
size: '40dp', '40dp'
allow_stretch: True
Image:
id: img_play
opacity: 1
source: 'res/ic_play_arrow_white_48dp.png'
center_y: self.parent.center_y
center_x: self.parent.center_x
size: '40dp', '40dp'
allow_stretch: True
Label:
id: status_bar
text_size: self.size
valign: 'top'
halign: 'center'
font_size: '10sp'
PageLayout:
Month:
id: current_month
calendar: root
label: "current"
Month:
id: next_month
calendar: root
label: "next"
<Header>:
height: '30dp'
size_hint_y: None
Button:
text: root.text
on_press: root.request_weekday()
<Month>:
month: month
name: month_name
BoxLayout:
orientation: "vertical"
canvas:
Color:
rgba: .1, .1, .1, 1
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
padding: ['10dp','10dp','10dp','1dp']
spacing: '2dp'
height: '40dp'
size_hint_y: None
Button:
id: month_name
on_press: root.request_month()
GridLayout:
id: month
cols: 7
padding: ['10dp','1dp','10dp','10dp']
spacing: '2dp'
<Day>:
day_button: day_button
on_pos: self.redraw()
on_size: self.redraw()
Button:
id: day_button
halign: 'center'
valign: 'middle'
font_size: '10sp'
on_press: root.toggle()
<SettingPassword>:
Label:
text: root.mask(root.value) or ''
pos: root.pos
font_size: '15sp'