X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=musicsampler.kv;h=3bf344e61a744b9b199edab63b527843cf9c7cc5;hb=b68b4e8fd7e0769e6c33f68f6b6d9db190a41b54;hp=3c1964bfe3eec5911fca08e3735a8ee5a25bffb4;hpb=8612c5f8bb0fc9529bc489a6719654d4474db6d5;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/musicsampler.kv b/musicsampler.kv index 3c1964b..3bf344e 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 @@ -114,7 +122,7 @@ 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,7 +133,7 @@ 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 color: 0, 0, 0, 1 @@ -137,7 +145,7 @@ 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)) color: 0, 0, 0, 1 text: "\n".join(map(lambda x: x[1], self.parent.action_list)) @@ -158,7 +166,7 @@ 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 color: 0, 0, 0, 1 @@ -170,7 +178,7 @@ 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 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))