X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=musicsampler.kv;h=4a44069c03bf1154f023470ad59f2cafbaf3e63d;hb=8601cdd853f205bdbc83dd78220f5e99ab624b68;hp=3c1964bfe3eec5911fca08e3735a8ee5a25bffb4;hpb=8612c5f8bb0fc9529bc489a6719654d4474db6d5;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/musicsampler.kv b/musicsampler.kv index 3c1964b..4a44069 100644 --- a/musicsampler.kv +++ b/musicsampler.kv @@ -1,4 +1,5 @@ #:import math math +#:import h helpers : pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x @@ -32,7 +33,7 @@ width: self.line_width Label: id: key_label - font_name: "fonts/Ubuntu-B.ttf" + font_name: h.path() + "fonts/Ubuntu-B.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size)) color: 0, 0, 0, 1 text: self.parent.key_sym @@ -44,7 +45,7 @@ center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5 Label: id: key_description_title - font_name: "fonts/Ubuntu-Regular.ttf" + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2)) color: 0, 0, 0, 1 text: self.parent.description_title @@ -55,7 +56,7 @@ center_y: self.parent.y + self.parent.height - self.texture_size[1] /2 - 5 Label: id: key_description - font_name: "fonts/Ubuntu-Regular.ttf" + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2)) color: 0, 0, 0, 1 text: "\n".join(self.parent.description) @@ -67,6 +68,13 @@ size: 2 * self.parent.width - 2 * self.parent.line_width, self.parent.height - key_label.font_size : + canvas: + Color: + rgba: 229/255, 228/255, 226/255, 1 + Rectangle: + pos: 0, 0 + size: self.width, self.height + key_size: int( (3 * self.width - 16) / 56) key_sep: int( self.key_size / 24) key_pad_sep: int( self.key_size / 7) + 1 @@ -86,6 +94,38 @@ play_list_y: self.border play_list_x: self.action_list_width + 2 * self.border + 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: h.path() + "fonts/Symbola.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: mock_ubuntu_regular + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Label: + id: mock_ubuntu_bold + font_name: h.path() + "fonts/Ubuntu-B.ttf" + font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + color: 0, 0, 0, 0 + text: "A" + text_size: None, None + size_hint: None, None + size: self.texture_size + Mapping: id: Mapping pos: self.parent.mapping_x, self.parent.mapping_y @@ -112,9 +152,10 @@ Rectangle: pos: 0, 0 size: self.width, self.height + Label: id: action_list_title - font_name: "fonts/Ubuntu-B.ttf" + font_name: h.path() + "fonts/Ubuntu-B.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) color: 0, 0, 0, 1 text: self.parent.action_title @@ -125,9 +166,9 @@ size: self.texture_size[0], self.parent.height Label: id: action_list_icons - font_name: "fonts/Symbola.ttf" + font_name: h.path() + "fonts/Symbola.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - line_height: 1.2 # FIXME: Donner la bonne taille de label + 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.action_list)) text_size: None, self.parent.height @@ -137,8 +178,9 @@ size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size Label: id: action_list_names - font_name: "fonts/Ubuntu-Regular.ttf" + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + line_height: self.parent.parent.ubuntu_regular_line_height or 1 color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[1], self.parent.action_list)) text_size: None, self.parent.height @@ -156,11 +198,12 @@ Rectangle: pos: 0, 0 size: self.width, self.height + Label: id: playlist_icons - font_name: "fonts/Symbola.ttf" + font_name: h.path() + "fonts/Symbola.ttf" font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) - line_height: 1.2 # FIXME: Donner la bonne taille de label + 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 @@ -170,7 +213,8 @@ size: self.texture_size[0], self.parent.height Label: id: playlist_names - font_name: "fonts/Ubuntu-Regular.ttf" # FIXME: Mettre en gras quand c'est en cours + font_name: h.path() + "fonts/Ubuntu-Regular.ttf" # 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))