/
filechooserUTF8.kv
375 lines (315 loc) · 9.37 KB
/
filechooserUTF8.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<TypeDropDown@DropDown>:
scroll_timeout: 0
<ButtonDropDown@Button1>:
size: 210, 20
on_release: app.root.dropdown_selection(self.index)
<NavigationButton@Button>:
size_hint: None, None
size: 25, 25
pos_hint: {'center_y': 0.5}
#background_normal: 'buttons\\normal.png'
#background_down: 'buttons\\pressed.png'
border: 0, 0, 0, 0
disabled: True
<PathInput@TextInput>:
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
multiline: False
foreground_color: 0.3, 0.3, 0.3, 1
padding: 3, 0
border: 0,16,0,16
background_normal: ''
background_active: ''
on_text_validate: app.root.receive_path(self.text)
cursor_color: 0, 0, 0, 1
<Button1@Button>:
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
size_hint: None, None
background_normal: 'buttons\\normal.png'
background_down: 'buttons\\pressed.png'
background_disabled_normal: 'buttons\\disabled.png'
disabled_color: 0.1, 0.1, 0.1, 0.4
<FieldNames@Button>:
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
background_normal: 'buttons\\transparency.png'
background_down: 'buttons\\pressed.png'
border: 0, 0, 0, 0
halign: 'left'
text_size: self.size
shorten: True
shorten_from: 'right'
padding: 3, 0
canvas.before:
Color:
rgba: 0.2, 0.2, 0.2, 1
Rectangle:
size: self.size
pos: self.pos
# <FileEntry@ToggleButton>:
# size_hint: 1, 1
# background_normal: 'buttons\\transparency.png'
# background_down: 'buttons\\pressed.png'
# disabled_color: 0.1, 0.1, 0.1, 0.4
# border: 0, 0, 0, 0
# halign: 'left'
# text_size: self.size
# shorten: True
# shorten_from: 'right'
# padding: 3, 0
# #on_release: app.root.select_file(self)
# on_press: app.root.select_file(self)
# min_state_time: 0
<Entry@ToggleButton>:
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
border: 0, 0, 0, 0
halign: 'left'
text_size: self.size
shorten: True
shorten_from: 'right'
padding: 3, 0
background_normal: 'buttons\\transparency.png'
background_down: 'buttons\\transparency.png'
index: ''
on_press: app.root.select_file(self.parent.index, self.state)
<FileEntry@BoxLayout>:
size_hint: 1, 1
background_normal: 'buttons\\pressed.png'
background_down: 'buttons\\pressed.png'
#disabled_color: 0.1, 0.1, 0.1, 0.4
Entry:
id: name
size_hint: None, 1
size: root.width - 400, 0
Entry:
id: moddate
size_hint: None, 1
size: 200, 0
Entry:
id: type
size_hint: None, 1
size: 100, 0
Entry:
id: size
size_hint: None, 1
size: 100, 0
<VerSeparator@Label>:
size_hint: None, 1
<ButtonsBar@RelativeLayout>:
size_hint: 1, None
size: 0, 30
canvas:
Color:
rgba: 0.2, 0.2, 0.2, 1
Rectangle:
size: self.size
pos: 0, 0
Label:
id: error_msg
pos_hint: {'center_y': 0.5}
pos: 3, 0
size_hint: None, None
size: 500, 20
halign: 'left'
padding: 3, 0
color: 1, 0, 0, 1
text_size: self.size
Button1:
pos_hint: {'center_y': 0.5}
pos: root.width - 2 * self.size[0] - 60, 0
size_hint: None, None
size: 100, 25
text: 'Open file'
on_release: app.root.open_file()
Button1:
pos_hint: {'center_y': 0.5}
pos: root.width - self.size[0] - 50, 0
size_hint: None, None
size: 100, 25
text: 'Cancel'
on_release: app.root.cancel()
<FileBar@RelativeLayout>:
size_hint: 1, None
size: 0, 30
canvas:
Color:
rgba: 0.2, 0.2, 0.2, 1
Rectangle:
size: self.size
pos: 0, 0
Label:
id: filename
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
pos_hint: {'center_y': 0.5}
pos: 0.1 * root.width, 0
size_hint: None, None
size: self.texture_size[0], 20
text: 'File name:'
# VerSeparator:
# size: 10, 0
PathInput:
id: fileinput
pos_hint: {'center_y': 0.5}
pos: root.ids.filename.pos[0] + root.ids.filename.size[0] + 10, 0
size_hint: None, None
size: root.ids.dropdown.pos[0] - 10 - self.pos[0], 20
# TypeDropDown:
# id: dropdown
# pos_hint: {'center_y': 0.5}
# pos: root.width - self.size[0] - 50, 0
# size_hint: None, None
# size: 210, 20
# Button1:
# #id: dropdown
# #pos_hint: {'center_y': 0.5}
# #pos: root.width - self.size[0] - 50, 0
# size_hint: 1, None
# size: 210, 20
# text: 'Pasu file (*.pasu)'
# #on_release: app.root.opendropdown(self)
Button1:
id: dropdown
pos_hint: {'center_y': 0.5}
pos: root.width - self.size[0] - 50, 0
size_hint: None, None
size: 210, 20
on_release: app.root.opendropdown(self)
<NavigationBar@BoxLayout>:
size_hint: 1, None
size: 0, 30
canvas:
Color:
rgba: 0.2, 0.2, 0.2, 1
Rectangle:
size: self.size
pos: self.pos
VerSeparator:
size: 10, 0
NavigationButton:
id: back
background_normal: 'buttons\\back_normal.png'
background_down: 'buttons\\back_pressed.png'
background_disabled_normal: 'buttons\\back_disabled.png'
background_disabled_down: 'buttons\\back_disabled.png'
on_release: app.root.back()
VerSeparator:
size: 2, 0
NavigationButton:
id: forward
background_normal: 'buttons\\forward_normal.png'
background_down: 'buttons\\forward_pressed.png'
background_disabled_normal: 'buttons\\forward_disabled.png'
background_disabled_down: 'buttons\\forward_disabled.png'
on_release: app.root.forward()
VerSeparator:
size: 2, 0
NavigationButton:
id: upper
background_normal: 'buttons\\upper_normal.png'
background_down: 'buttons\\upper_pressed.png'
background_disabled_normal: 'buttons\\upper_disabled.png'
background_disabled_down: 'buttons\\upper_disabled.png'
on_release: app.root.up()
VerSeparator:
size: 4, 0
PathInput:
id: pathinput
size_hint: 1, None
size: 0, 20
pos_hint: {'center_y': 0.5}
VerSeparator:
size: 10, 0
<ListPane@BoxLayout>:
orientation: 'vertical'
GridLayout:
cols: 4
size_hint: 1, None
#size: 0, 20
height: self.minimum_height
row_default_height: 20
row_force_default: True
cols_minimum: {0: root.width - 400, 1:200, 2:100, 3:100}
#cols_minimum: app.root.b
col_force_default: True
FieldNames:
text: 'Name'
#text: app.root.gg
FieldNames:
text: 'Modification date'
FieldNames:
text: 'Type'
FieldNames:
text: 'Size'
ScrollView:
scroll_timeout: 0
bar_width: 15
bar_inactive_color: 0.7, 0.7, 0.7, 0.4
scroll_type: ['bars', 'content']
GridLayout:
id: files_list
cols: 1
spacing: 0
height: self.minimum_height
size_hint: 1, None
row_default_height: 20
row_force_default: True
#cols_minimum: {0: root.width - 400, 1:200, 2:100, 3:100}
<SideBar@BoxLayout>:
size_hint: None, 1
size: 170, 0
canvas:
Color:
rgba: 0.35, 0.35, 0.35, 1
Rectangle:
size: self.size
pos: self.pos
ScrollView:
scroll_timeout: 0
bar_width: 15
bar_inactive_color: 0.7, 0.7, 0.7, 0.4
scroll_type: ['bars', 'content']
GridLayout:
id: drives_grid
cols: 1
spacing: 1
height: self.minimum_height
size_hint: 1, None
padding: 3, 3
<PartitionEntry@ToggleButton>:
font_name: "fonts\\NotoSansCJK-Medium.ttc"
font_size: 12
size_hint: 1, None
size: 0, 20
background_normal: 'buttons\\transparency.png'
background_down: 'buttons\\pressed.png'
background_disabled_normal: 'buttons\\disabled.png'
disabled_color: 0.1, 0.1, 0.1, 0.4
halign: 'left'
text_size: self.size
shorten: True
shorten_from: 'right'
padding: 3, 0
on_press: app.root.select_drive(self)
min_state_time: 0
already_selected: False
#on_press: print(self.state)
<MainPane@BoxLayout>:
orientation: 'horizontal'
SideBar:
ListPane:
<InterfaceWidget>:
font_name: 'Arial'
NavigationBar:
id: navbar
pos: 0, root.height - 30
FileBar:
pos: 0, 30
ButtonsBar:
pos: 0, 0
MainPane:
pos: 0, 60
size_hint: 1, None
size: 0, root.ids.navbar.pos[1] - 60