From d734981b5145f1798f3301c135dc577b7aef293e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 28 Jul 2016 17:26:26 +0200 Subject: Use labels stacking to build playlist --- music_sampler/music_sampler.kv | 92 +++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'music_sampler/music_sampler.kv') 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 @@ action_list_y: self.border play_list_height: self.action_list_height - play_list_width: self.width - self.action_list_width - 3* self.border + play_list_width: self.width - self.key_list_width - self.action_list_width - 4* self.border play_list_y: self.border play_list_x: self.action_list_width + self.key_list_width + 3 * self.border + max_height: max(mock_symbola.height, mock_ubuntu_regular.height, mock_ubuntu_bold.height) min_height: min(mock_symbola.height, mock_ubuntu_regular.height, mock_ubuntu_bold.height) symbola_line_height: self.min_height / max(mock_symbola.height,1) ubuntu_regular_line_height: self.min_height / max(mock_ubuntu_regular.height,1) ubuntu_bold_line_height: self.min_height / max(mock_ubuntu_bold.height,1) + Label: id: mock_symbola font_name: "Symbola" @@ -271,58 +273,56 @@ : size_hint: None, None + labels_height: self.parent.max_height or 1 canvas: Color: rgba: 250./255, 250./255, 250./255, 1 Rectangle: pos: 0, 0 size: self.width, self.height - - Label: - id: playlist_icons - font_name: "Symbola" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - line_height: self.parent.parent.symbola_line_height or 1 - color: 0, 0, 0, 1 - text: "\n".join(map(lambda x: x[0], self.parent.playlist)) - text_size: None, self.parent.height - halign: "left" - valign: "top" - size_hint: None, None - size: self.texture_size[0], self.parent.height - Label: - id: playlist_names - font_name: "Ubuntu" # FIXME: Mettre en gras quand c'est en cours - line_height: self.parent.parent.ubuntu_regular_line_height or 1 - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - color: 0, 0, 0, 1 - text: "\n".join(map(lambda x: x[1], self.parent.playlist)) - text_size: None, self.parent.height - halign: "left" - valign: "top" - size_hint: None, None - pos: 15, self.y - size: self.texture_size[0], self.parent.height - Label: - canvas.before: - Color: - rgba: 250./255, 250./255, 250./255, 1 - Rectangle: - pos: self.pos - size: self.width, self.height - id: playlist_times - font_name: "Ubuntu" - line_height: self.parent.parent.ubuntu_regular_line_height or 1 - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - color: 0, 0, 0, 1 - text: "\n".join(map(lambda x: x[2], self.parent.playlist)) - text_size: None, self.parent.height - halign: "left" - valign: "top" - size_hint: None, None - pos: self.parent.width - 3 * self.width / 2 - 2 * (self.parent.parent.border or 0), self.y - size: self.texture_size[0], self.parent.height + PlayListIcons: + orientation: 'lr-tb' + size_hint: 0.05, 1 + pos_hints: { 'x': 0, 'top': 0 } + PlayListNames: + orientation: 'lr-tb' + pos_hint: { 'x': 0.05, 'bottom': 0 } + size_hint: 0.65, 1 + PlayListTimes: + orientation: 'lr-tb' + pos_hint: { 'x': 0.7, 'bottom': 0 } + size_hint: 0.30, 1 +: + font_name: "Symbola" + color: 0, 0, 0, 1 + text_size: None, None + halign: "left" + size_hint: 1, None + width: self.texture_size[0] + +: + font_name: "Ubuntu" + color: 0, 0, 0, 1 + text_size: None, None + halign: "left" + size_hint: None, None + width: self.texture_size[0] + +: + canvas.before: + Color: + rgba: 250./255, 250./255, 250./255, 1 + Rectangle: + pos: self.pos + size: self.width, self.height + font_name: "Ubuntu" + color: 0, 0, 0, 1 + text_size: None, None + halign: "left" + size_hint: None, None + width: self.texture_size[0] + : size_hint: None, None key_size: 48 -- cgit v1.2.3