diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-28 17:26:26 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-28 17:27:48 +0200 |
commit | d734981b5145f1798f3301c135dc577b7aef293e (patch) | |
tree | 50dc1bc8d00d3f853bff71a03be05111d7a44b7b /music_sampler/music_sampler.kv | |
parent | d7d6f2bebfc9eb4f3f8233eb70577e4c2ff31bd3 (diff) | |
download | MusicSampler-d734981b5145f1798f3301c135dc577b7aef293e.tar.gz MusicSampler-d734981b5145f1798f3301c135dc577b7aef293e.tar.zst MusicSampler-d734981b5145f1798f3301c135dc577b7aef293e.zip |
Use labels stacking to build playlist
Diffstat (limited to 'music_sampler/music_sampler.kv')
-rw-r--r-- | music_sampler/music_sampler.kv | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/music_sampler/music_sampler.kv b/music_sampler/music_sampler.kv index 9057532..8e94da8 100644 --- a/music_sampler/music_sampler.kv +++ b/music_sampler/music_sampler.kv | |||
@@ -105,14 +105,16 @@ | |||
105 | action_list_y: self.border | 105 | action_list_y: self.border |
106 | 106 | ||
107 | play_list_height: self.action_list_height | 107 | play_list_height: self.action_list_height |
108 | play_list_width: self.width - self.action_list_width - 3* self.border | 108 | play_list_width: self.width - self.key_list_width - self.action_list_width - 4* self.border |
109 | play_list_y: self.border | 109 | play_list_y: self.border |
110 | play_list_x: self.action_list_width + self.key_list_width + 3 * self.border | 110 | play_list_x: self.action_list_width + self.key_list_width + 3 * self.border |
111 | 111 | ||
112 | max_height: max(mock_symbola.height, mock_ubuntu_regular.height, mock_ubuntu_bold.height) | ||
112 | min_height: min(mock_symbola.height, mock_ubuntu_regular.height, mock_ubuntu_bold.height) | 113 | min_height: min(mock_symbola.height, mock_ubuntu_regular.height, mock_ubuntu_bold.height) |
113 | symbola_line_height: self.min_height / max(mock_symbola.height,1) | 114 | symbola_line_height: self.min_height / max(mock_symbola.height,1) |
114 | ubuntu_regular_line_height: self.min_height / max(mock_ubuntu_regular.height,1) | 115 | ubuntu_regular_line_height: self.min_height / max(mock_ubuntu_regular.height,1) |
115 | ubuntu_bold_line_height: self.min_height / max(mock_ubuntu_bold.height,1) | 116 | ubuntu_bold_line_height: self.min_height / max(mock_ubuntu_bold.height,1) |
117 | |||
116 | Label: | 118 | Label: |
117 | id: mock_symbola | 119 | id: mock_symbola |
118 | font_name: "Symbola" | 120 | font_name: "Symbola" |
@@ -271,58 +273,56 @@ | |||
271 | 273 | ||
272 | <PlayList>: | 274 | <PlayList>: |
273 | size_hint: None, None | 275 | size_hint: None, None |
276 | labels_height: self.parent.max_height or 1 | ||
274 | canvas: | 277 | canvas: |
275 | Color: | 278 | Color: |
276 | rgba: 250./255, 250./255, 250./255, 1 | 279 | rgba: 250./255, 250./255, 250./255, 1 |
277 | Rectangle: | 280 | Rectangle: |
278 | pos: 0, 0 | 281 | pos: 0, 0 |
279 | size: self.width, self.height | 282 | size: self.width, self.height |
280 | 283 | PlayListIcons: | |
281 | Label: | 284 | orientation: 'lr-tb' |
282 | id: playlist_icons | 285 | size_hint: 0.05, 1 |
283 | font_name: "Symbola" | 286 | pos_hints: { 'x': 0, 'top': 0 } |
284 | font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) | 287 | PlayListNames: |
285 | line_height: self.parent.parent.symbola_line_height or 1 | 288 | orientation: 'lr-tb' |
286 | color: 0, 0, 0, 1 | 289 | pos_hint: { 'x': 0.05, 'bottom': 0 } |
287 | text: "\n".join(map(lambda x: x[0], self.parent.playlist)) | 290 | size_hint: 0.65, 1 |
288 | text_size: None, self.parent.height | 291 | PlayListTimes: |
289 | halign: "left" | 292 | orientation: 'lr-tb' |
290 | valign: "top" | 293 | pos_hint: { 'x': 0.7, 'bottom': 0 } |
291 | size_hint: None, None | 294 | size_hint: 0.30, 1 |
292 | size: self.texture_size[0], self.parent.height | ||
293 | Label: | ||
294 | id: playlist_names | ||
295 | font_name: "Ubuntu" # FIXME: Mettre en gras quand c'est en cours | ||
296 | line_height: self.parent.parent.ubuntu_regular_line_height or 1 | ||
297 | font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) | ||
298 | color: 0, 0, 0, 1 | ||
299 | text: "\n".join(map(lambda x: x[1], self.parent.playlist)) | ||
300 | text_size: None, self.parent.height | ||
301 | halign: "left" | ||
302 | valign: "top" | ||
303 | size_hint: None, None | ||
304 | pos: 15, self.y | ||
305 | size: self.texture_size[0], self.parent.height | ||
306 | Label: | ||
307 | canvas.before: | ||
308 | Color: | ||
309 | rgba: 250./255, 250./255, 250./255, 1 | ||
310 | Rectangle: | ||
311 | pos: self.pos | ||
312 | size: self.width, self.height | ||
313 | id: playlist_times | ||
314 | font_name: "Ubuntu" | ||
315 | line_height: self.parent.parent.ubuntu_regular_line_height or 1 | ||
316 | font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) | ||
317 | color: 0, 0, 0, 1 | ||
318 | text: "\n".join(map(lambda x: x[2], self.parent.playlist)) | ||
319 | text_size: None, self.parent.height | ||
320 | halign: "left" | ||
321 | valign: "top" | ||
322 | size_hint: None, None | ||
323 | pos: self.parent.width - 3 * self.width / 2 - 2 * (self.parent.parent.border or 0), self.y | ||
324 | size: self.texture_size[0], self.parent.height | ||
325 | 295 | ||
296 | <PlayListIcon>: | ||
297 | font_name: "Symbola" | ||
298 | color: 0, 0, 0, 1 | ||
299 | text_size: None, None | ||
300 | halign: "left" | ||
301 | size_hint: 1, None | ||
302 | width: self.texture_size[0] | ||
303 | |||
304 | <PlayListName>: | ||
305 | font_name: "Ubuntu" | ||
306 | color: 0, 0, 0, 1 | ||
307 | text_size: None, None | ||
308 | halign: "left" | ||
309 | size_hint: None, None | ||
310 | width: self.texture_size[0] | ||
311 | |||
312 | <PlayListTime>: | ||
313 | canvas.before: | ||
314 | Color: | ||
315 | rgba: 250./255, 250./255, 250./255, 1 | ||
316 | Rectangle: | ||
317 | pos: self.pos | ||
318 | size: self.width, self.height | ||
319 | font_name: "Ubuntu" | ||
320 | color: 0, 0, 0, 1 | ||
321 | text_size: None, None | ||
322 | halign: "left" | ||
323 | size_hint: None, None | ||
324 | width: self.texture_size[0] | ||
325 | |||
326 | <Mapping>: | 326 | <Mapping>: |
327 | size_hint: None, None | 327 | size_hint: None, None |
328 | key_size: 48 | 328 | key_size: 48 |