]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - musicsampler.kv
Fix font sizes
[perso/Immae/Projets/Python/MusicSampler.git] / musicsampler.kv
CommitLineData
8612c5f8 1#:import math math
bb69f62e 2#:import h helpers
8612c5f8
IB
3
4<Key>:
5 pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x
6 pad_cols: False
7
8 y: (self.parent.top-self.parent.y) - (self.row) * self.parent.key_size - (self.row - 1) * self.parent.key_sep
9 x: (self.col - 1) * self.parent.key_size + int(self.col - 1) * self.parent.key_sep + self.pad_col_sep
10 size_hint: None, None
11 line_color: 120/255, 120/255, 120/255, 1
12 enabled: True
13 line_width: 2
14 row: 1
15 col: 0
16 key_code: 0
17 key_sym: ""
18 key_width: 1
19 key_height: 1
20 width: self.key_width * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep
21 height: self.key_height * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep
22 canvas.before:
23 Color:
24 rgba: self.color
25 RoundedRectangle:
26 pos: self.x, self.y
27 size: self.size
28 canvas:
29 Color:
30 rgba: self.line_color
31 Line:
32 rounded_rectangle: self.x + self.line_width, self.y + self.line_width, self.width - 2 * self.line_width, self.height - 2 * self.line_width, 10
33 width: self.line_width
34 Label:
35 id: key_label
bb69f62e 36 font_name: h.path() + "fonts/Ubuntu-B.ttf"
8612c5f8
IB
37 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size))
38 color: 0, 0, 0, 1
39 text: self.parent.key_sym
40 text_size: self.parent.width,self.font_size
41 shorten: True
42 shorten_from: "right"
43 split_str: ""
44 center_x: self.parent.x + self.texture_size[0] /2 + 5
45 center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
46 Label:
47 id: key_description_title
bb69f62e 48 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8
IB
49 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
50 color: 0, 0, 0, 1
51 text: self.parent.description_title
52 text_size: self.parent.width - 2*self.parent.line_width, self.font_size
53 halign: "right"
54 valign: "middle"
55 center_x: self.parent.x + self.texture_size[0] /2
56 center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5
57 Label:
58 id: key_description
bb69f62e 59 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8
IB
60 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2))
61 color: 0, 0, 0, 1
62 text: "\n".join(self.parent.description)
63 text_size: 2 * self.parent.width,self.parent.height - key_label.font_size
64 halign: "left"
65 valign: "middle"
66 pos: self.parent.x + 2 * self.parent.line_width + 2, self.parent.y
67 size_hint: None, None
68 size: 2 * self.parent.width - 2 * self.parent.line_width, self.parent.height - key_label.font_size
69
70<Screen>:
4b2d79ca
IB
71 canvas:
72 Color:
73 rgba: 229/255, 228/255, 226/255, 1
74 Rectangle:
75 pos: 0, 0
76 size: self.width, self.height
77
8612c5f8
IB
78 key_size: int( (3 * self.width - 16) / 56)
79 key_sep: int( self.key_size / 24)
80 key_pad_sep: int( self.key_size / 7) + 1
81
82 border: (self.width - self.key_size * 18 - self.key_sep * 16 - self.key_pad_sep)/ 2
83
84 mapping_height: self.key_size * 6 + self.key_sep * 5
85 mapping_width: self.key_size * 18 + self.key_sep * 16 + self.key_pad_sep
86 mapping_x: self.border
87 mapping_y: self.top - self.mapping_height - self.border
88 action_list_height: self.height - self.mapping_height - 3 * self.border
89 action_list_width: 3 * self.width / 4
90 action_list_x: self.border
91 action_list_y: self.border
92 play_list_height: self.action_list_height
93 play_list_width: self.width - self.action_list_width - 3* self.border
94 play_list_y: self.border
95 play_list_x: self.action_list_width + 2 * self.border
96
97 Mapping:
98 id: Mapping
99 pos: self.parent.mapping_x, self.parent.mapping_y
100 size: self.parent.mapping_width, self.parent.mapping_height
101
102 key_size: self.parent.key_size
103 key_sep: self.parent.key_sep
104 key_pad_sep: self.parent.key_pad_sep
105 pad_x: self.key_size * 15 + 14 * self.key_sep + self.key_pad_sep
106 ActionList:
107 id: ActionList
108 pos: self.parent.action_list_x, self.parent.action_list_y
109 size: self.parent.action_list_width, self.parent.action_list_height
110 PlayList:
111 id: PlayList
112 pos: self.parent.play_list_x, self.parent.play_list_y
113 size: self.parent.play_list_width, self.parent.play_list_height
114
115<ActionList>:
7910d58d 116 min_height: min(action_list_mock_symbola.height, action_list_mock_ubuntu_regular.height, action_list_mock_ubuntu_bold.height)
8612c5f8
IB
117 size_hint: None, None
118 canvas:
119 Color:
120 rgba: 250./255, 250./255, 250./255, 1
121 Rectangle:
122 pos: 0, 0
123 size: self.width, self.height
7910d58d
IB
124 # FIXME: déplacer ça dans Screen?
125 Label:
126 id: action_list_mock_symbola
127 font_name: h.path() + "fonts/Symbola.ttf"
128 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
129 color: 0, 0, 0, 0
130 text: "A"
131 text_size: None, None
132 size_hint: None, None
133 size: self.texture_size
134 Label:
135 id: action_list_mock_ubuntu_regular
136 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
137 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
138 color: 0, 0, 0, 0
139 text: "A"
140 text_size: None, None
141 size_hint: None, None
142 size: self.texture_size
143 Label:
144 id: action_list_mock_ubuntu_bold
145 font_name: h.path() + "fonts/Ubuntu-B.ttf"
146 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
147 color: 0, 0, 0, 0
148 text: "A"
149 text_size: None, None
150 size_hint: None, None
151 size: self.texture_size
152
153
8612c5f8
IB
154 Label:
155 id: action_list_title
bb69f62e 156 font_name: h.path() + "fonts/Ubuntu-B.ttf"
8612c5f8
IB
157 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
158 color: 0, 0, 0, 1
159 text: self.parent.action_title
160 text_size: None, self.parent.height
161 halign: "left"
162 valign: "top"
163 size_hint: None, None
164 size: self.texture_size[0], self.parent.height
165 Label:
166 id: action_list_icons
bb69f62e 167 font_name: h.path() + "fonts/Symbola.ttf"
8612c5f8 168 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
7910d58d 169 line_height: self.parent.min_height / max(action_list_mock_symbola.height,1)
8612c5f8
IB
170 color: 0, 0, 0, 1
171 text: "\n".join(map(lambda x: x[0], self.parent.action_list))
172 text_size: None, self.parent.height
173 halign: "left"
174 valign: "top"
175 size_hint: None, None
176 size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
177 Label:
178 id: action_list_names
bb69f62e 179 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
8612c5f8 180 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
7910d58d 181 line_height: self.parent.min_height / max(action_list_mock_ubuntu_regular.height,1)
8612c5f8
IB
182 color: 0, 0, 0, 1
183 text: "\n".join(map(lambda x: x[1], self.parent.action_list))
184 text_size: None, self.parent.height
185 halign: "left"
186 valign: "top"
187 size_hint: None, None
188 pos: 15, self.y
189 size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
190
191<PlayList>:
7910d58d 192 min_height: min(playlist_mock_symbola.height, playlist_mock_ubuntu_regular.height, playlist_mock_ubuntu_bold.height)
8612c5f8
IB
193 size_hint: None, None
194 canvas:
195 Color:
196 rgba: 250./255, 250./255, 250./255, 1
197 Rectangle:
198 pos: 0, 0
199 size: self.width, self.height
7910d58d
IB
200 Label:
201 id: playlist_mock_symbola
202 font_name: h.path() + "fonts/Symbola.ttf"
203 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
204 color: 0, 0, 0, 0
205 text: "A"
206 text_size: None, None
207 size_hint: None, None
208 size: self.texture_size
209 Label:
210 id: playlist_mock_ubuntu_regular
211 font_name: h.path() + "fonts/Ubuntu-Regular.ttf"
212 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
213 color: 0, 0, 0, 0
214 text: "A"
215 text_size: None, None
216 size_hint: None, None
217 size: self.texture_size
218 Label:
219 id: playlist_mock_ubuntu_bold
220 font_name: h.path() + "fonts/Ubuntu-B.ttf"
221 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
222 color: 0, 0, 0, 0
223 text: "A"
224 text_size: None, None
225 size_hint: None, None
226 size: self.texture_size
227
228
8612c5f8
IB
229 Label:
230 id: playlist_icons
bb69f62e 231 font_name: h.path() + "fonts/Symbola.ttf"
8612c5f8 232 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
7910d58d 233 line_height: self.parent.min_height / max(playlist_mock_symbola.height,1)
8612c5f8
IB
234 color: 0, 0, 0, 1
235 text: "\n".join(map(lambda x: x[0], self.parent.playlist))
236 text_size: None, self.parent.height
237 halign: "left"
238 valign: "top"
239 size_hint: None, None
240 size: self.texture_size[0], self.parent.height
241 Label:
242 id: playlist_names
bb69f62e 243 font_name: h.path() + "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours
7910d58d 244 line_height: self.parent.min_height / max(playlist_mock_ubuntu_regular.height,1)
8612c5f8
IB
245 font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10))
246 color: 0, 0, 0, 1
247 text: "\n".join(map(lambda x: x[1], self.parent.playlist))
248 text_size: None, self.parent.height
249 halign: "left"
250 valign: "top"
251 size_hint: None, None
252 pos: 15, self.y
253 size: self.texture_size[0], self.parent.height
254
255<Mapping>:
256 size_hint: None, None
257 key_size: 48
258 key_sep: 2
259 key_pad_sep: 7
260 pad_x: 755
261 canvas:
262 Color:
263 rgba: 250./255, 250./255, 250./255, 1
264 Rectangle:
265 pos: 0, 0
266 size: self.width, self.height
267 Key:
268 id: Key_27
269 key_code: 27
270 key_sym: "ESC"
271 row: 1
272 col: 1
273 Key:
274 id: Key_282
275 key_code: 282
276 key_sym: "F1"
277 row: 1
278 col: 3
279 Key:
280 id: Key_283
281 key_code: 283
282 key_sym: "F2"
283 row: 1
284 col: 4
285 Key:
286 id: Key_284
287 key_code: 284
288 key_sym: "F3"
289 row: 1
290 col: 5
291 Key:
292 id: Key_285
293 key_code: 285
294 key_sym: "F4"
295 row: 1
296 col: 6
297
298 Key:
299 id: Key_286
300 key_code: 286
301 key_sym: "F5"
302 row: 1
303 col: 7.5
304 Key:
305 id: Key_287
306 key_code: 287
307 key_sym: "F6"
308 row: 1
309 col: 8.5
310 Key:
311 id: Key_288
312 key_code: 288
313 key_sym: "F7"
314 row: 1
315 col: 9.5
316 Key:
317 id: Key_289
318 key_code: 289
319 key_sym: "F8"
320 row: 1
321 col: 10.5
322
323 Key:
324 id: Key_290
325 key_code: 290
326 key_sym: "F9"
327 row: 1
328 col: 12
329 Key:
330 id: Key_291
331 key_code: 291
332 key_sym: "F10"
333 row: 1
334 col: 13
335 Key:
336 id: Key_292
337 key_code: 292
338 key_sym: "F11"
339 row: 1
340 col: 14
341 Key:
342 id: Key_293
343 key_code: 293
344 key_sym: "F12"
345 row: 1
346 col: 15
347
348 Key:
349 id: Key_178
350 key_code: 178
351 key_sym: "²"
352 row: 2
353 col: 1
354 Key:
355 id: Key_38
356 key_code: 38
357 key_sym: "&"
358 row: 2
359 col: 2
360 Key:
361 id: Key_233
362 key_code: 233
363 key_sym: "é"
364 row: 2
365 col: 3
366 Key:
367 id: Key_34
368 key_code: 34
369 key_sym: '"'
370 row: 2
371 col: 4
372 Key:
373 id: Key_39
374 key_code: 39
375 key_sym: "'"
376 row: 2
377 col: 5
378 Key:
379 id: Key_40
380 key_code: 40
381 key_sym: "("
382 row: 2
383 col: 6
384 Key:
385 id: Key_45
386 key_code: 45
387 key_sym: "-"
388 row: 2
389 col: 7
390 Key:
391 id: Key_232
392 key_code: 232
393 key_sym: "è"
394 row: 2
395 col: 8
396 Key:
397 id: Key_95
398 key_code: 95
399 key_sym: "_"
400 row: 2
401 col: 9
402 Key:
403 id: Key_231
404 key_code: 231
405 key_sym: "ç"
406 row: 2
407 col: 10
408 Key:
409 id: Key_224
410 key_code: 224
411 key_sym: "à"
412 row: 2
413 col: 11
414 Key:
415 id: Key_41
416 key_code: 41
417 key_sym: ")"
418 row: 2
419 col: 12
420 Key:
421 id: Key_61
422 key_code: 61
423 key_sym: "="
424 row: 2
425 col: 13
426 Key:
427 id: Key_8
428 key_code: 8
429 key_sym: "<-"
430 row: 2
431 col: 14
432 key_width: 2
433 Key:
434 id: Key_9
435 key_code: 9
436 key_sym: "tab"
437 row: 3
438 col: 1
439 key_width: 1.48
440 Key:
441 id: Key_97
442 key_code: 97
443 key_sym: "a"
444 row: 3
445 col: 2.5
446 Key:
447 id: Key_122
448 key_code: 122
449 key_sym: "z"
450 row: 3
451 col: 3.5
452 Key:
453 id: Key_101
454 key_code: 101
455 key_sym: "e"
456 row: 3
457 col: 4.5
458 Key:
459 id: Key_114
460 key_code: 114
461 key_sym: "r"
462 row: 3
463 col: 5.5
464 Key:
465 id: Key_116
466 key_code: 116
467 key_sym: "t"
468 row: 3
469 col: 6.5
470 Key:
471 id: Key_121
472 key_code: 121
473 key_sym: "y"
474 row: 3
475 col: 7.5
476 Key:
477 id: Key_117
478 key_code: 117
479 key_sym: "u"
480 row: 3
481 col: 8.5
482 Key:
483 id: Key_105
484 key_code: 105
485 key_sym: "i"
486 row: 3
487 col: 9.5
488 Key:
489 id: Key_111
490 key_code: 111
491 key_sym: "o"
492 row: 3
493 col: 10.5
494 Key:
495 id: Key_112
496 key_code: 112
497 key_sym: "p"
498 row: 3
499 col: 11.5
500 Key:
501 id: Key_94
502 key_code: 94
503 key_sym: "^"
504 row: 3
505 col: 12.5
506 Key:
507 id: Key_36
508 key_code: 36
509 key_sym: "$"
510 row: 3
511 col: 13.5
512 Key:
513 id: Key_13
514 key_code: 13
515 key_sym: "Enter"
516 row: 4
517 col: 14.8
518 key_width: 1.23
519 key_height: 2
520 Key:
521 id: Key_301
522 key_code: 301
523 key_sym: "CAPS"
524 row: 4
525 col: 1
526 key_width: 1.75
527 line_width: 1
528 enabled: False
529
530 Key:
531 id: Key_113
532 key_code: 113
533 key_sym: "q"
534 row: 4
535 col: 2.8
536 Key:
537 id: Key_115
538 key_code: 115
539 key_sym: "s"
540 row: 4
541 col: 3.8
542 Key:
543 id: Key_100
544 key_code: 100
545 key_sym: "d"
546 row: 4
547 col: 4.8
548 Key:
549 id: Key_102
550 key_code: 102
551 key_sym: "f"
552 row: 4
553 col: 5.8
554 Key:
555 id: Key_103
556 key_code: 103
557 key_sym: "g"
558 row: 4
559 col: 6.8
560 Key:
561 id: Key_104
562 key_code: 104
563 key_sym: "h"
564 row: 4
565 col: 7.8
566 Key:
567 id: Key_106
568 key_code: 106
569 key_sym: "j"
570 row: 4
571 col: 8.8
572 Key:
573 id: Key_107
574 key_code: 107
575 key_sym: "k"
576 row: 4
577 col: 9.8
578 Key:
579 id: Key_108
580 key_code: 108
581 key_sym: "l"
582 row: 4
583 col: 10.8
584 Key:
585 id: Key_109
586 key_code: 109
587 key_sym: "m"
588 row: 4
589 col: 11.8
590 Key:
591 id: Key_249
592 key_code: 249
593 key_sym: "ù"
594 row: 4
595 col: 12.8
596 Key:
597 id: Key_42
598 key_code: 42
599 key_sym: "*"
600 row: 4
601 col: 13.8
602 Key:
603 id: Key_304
604 key_code: 304
605 key_sym: "LShift"
606 row: 5
607 col: 1
608 key_width: 1.3
609 line_width: 1
610 enabled: False
611 Key:
612 id: Key_60
613 key_code: 60
614 key_sym: "<"
615 row: 5
616 col: 2.3
617 Key:
618 id: Key_119
619 key_code: 119
620 key_sym: "w"
621 row: 5
622 col: 3.3
623 Key:
624 id: Key_120
625 key_code: 120
626 key_sym: "x"
627 row: 5
628 col: 4.3
629 Key:
630 id: Key_99
631 key_code: 99
632 key_sym: "c"
633 row: 5
634 col: 5.3
635 Key:
636 id: Key_118
637 key_code: 118
638 key_sym: "v"
639 row: 5
640 col: 6.3
641 Key:
642 id: Key_98
643 key_code: 98
644 key_sym: "b"
645 row: 5
646 col: 7.3
647 Key:
648 id: Key_110
649 key_code: 110
650 key_sym: "n"
651 row: 5
652 col: 8.3
653 Key:
654 id: Key_44
655 key_code: 44
656 key_sym: ","
657 row: 5
658 col: 9.3
659 Key:
660 id: Key_59
661 key_code: 59
662 key_sym: ";"
663 row: 5
664 col: 10.3
665 Key:
666 id: Key_58
667 key_code: 58
668 key_sym: ":"
669 row: 5
670 col: 11.3
671 Key:
672 id: Key_33
673 key_code: 33
674 key_sym: "!"
675 row: 5
676 col: 12.3
677 Key:
678 id: Key_303
679 key_code: 303
680 key_sym: "RShift"
681 row: 5
682 col: 13.3
683 key_width: 2.7
684 line_width: 1
685 enabled: False
686 Key:
687 id: Key_306
688 key_code: 306
689 key_sym: "LCtrl"
690 row: 6
691 col: 1
692 key_width: 1.3
693 line_width: 1
694 enabled: False
695 Key:
696 id: Key_311
697 key_code: 311
698 key_sym: "LSuper"
699 row: 6
700 col: 3.3
701 line_width: 1
702 enabled: False
703 Key:
704 id: Key_308
705 key_code: 308
706 key_sym: "LAlt"
707 row: 6
708 col: 4.3
709 line_width: 1
710 enabled: False
711 Key:
712 id: Key_32
713 key_code: 32
714 key_sym: "Espace"
715 row: 6
716 col: 5.3
717 key_width: 5
718 Key:
719 id: Key_313
720 key_code: 313
721 key_sym: "AltGr"
722 row: 6
723 col: 10.3
724 line_width: 1
725 enabled: False
726 Key:
727 id: Key_314
728 key_code: 314
729 key_sym: "Compose"
730 row: 6
731 col: 11.3
732 line_width: 1
733 enabled: False
734 Key:
735 id: Key_305
736 key_code: 305
737 key_sym: "RCtrl"
738 row: 6
739 col: 12.3
740 key_width: 1.3
741 line_width: 1
742 enabled: False
743
744
745 Key:
746 id: Key_277
747 key_code: 277
748 key_sym: "ins"
749 row: 2
750 col: 1
751 pad_cols: True
752 Key:
753 id: Key_278
754 key_code: 278
755 key_sym: "home"
756 row: 2
757 col: 2
758 pad_cols: True
759 Key:
760 id: Key_280
761 key_code: 280
762 key_sym: "pg_u"
763 row: 2
764 col: 3
765 pad_cols: True
766 Key:
767 id: Key_127
768 key_code: 127
769 key_sym: "del"
770 row: 3
771 col: 1
772 pad_cols: True
773 Key:
774 id: Key_279
775 key_code: 279
776 key_sym: "end"
777 row: 3
778 col: 2
779 pad_cols: True
780 Key:
781 id: Key_281
782 key_code: 281
783 key_sym: "pg_d"
784 row: 3
785 col: 3
786 pad_cols: True
787 Key:
788 id: Key_273
789 key_code: 273
790 key_sym: "up"
791 row: 5
792 col: 2
793 pad_cols: True
794 Key:
795 id: Key_274
796 key_code: 274
797 key_sym: "down"
798 row: 6
799 col: 2
800 pad_cols: True
801 Key:
802 id: Key_276
803 key_code: 276
804 key_sym: "left"
805 row: 6
806 col: 1
807 pad_cols: True
808 Key:
809 id: Key_275
810 key_code: 275
811 key_sym: "right"
812 row: 6
813 col: 3
814 pad_cols: True