X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=music_sampler%2Fmusic_sampler.kv;h=839d2ce5d50cf30b692b1504b0b57b2347acfe53;hb=269c6bdaba62b79bb832d3e1cc516fff013a7dc3;hp=ffc2797e0bf44c8df87dbd2fba7e6940b5091a75;hpb=4d1dfc89066e8dbccf7e5049686895de6fcb32d2;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/music_sampler/music_sampler.kv b/music_sampler/music_sampler.kv index ffc2797..839d2ce 100644 --- a/music_sampler/music_sampler.kv +++ b/music_sampler/music_sampler.kv @@ -1,5 +1,4 @@ #:import math math -#:import h music_sampler : pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x @@ -18,6 +17,8 @@ key_height: 1 width: self.key_width * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep height: self.key_height * (self.parent.key_size + self.parent.key_sep) - self.parent.key_sep + normal_font_size: self.parent.font_size + smaller_font_size: math.ceil(2 * math.sqrt(self.parent.key_size / 2)) canvas.before: Color: rgba: self.color @@ -42,7 +43,7 @@ id: key_label font_name: "Ubuntu" bold: True - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size)) + font_size: self.parent.normal_font_size or 10 color: 0, 0, 0, 1 text: self.parent.key_sym text_size: self.parent.width,self.font_size @@ -54,7 +55,7 @@ Label: id: key_description_title font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2)) + font_size: self.parent.smaller_font_size or 8 color: 0, 0, 0, 1 text: self.parent.description_title text_size: self.parent.width - 2*self.parent.line_width, self.font_size @@ -65,7 +66,7 @@ Label: id: key_description font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size / 2)) + font_size: self.parent.smaller_font_size or 8 color: 0, 0, 0, 1 text: "\n".join(self.parent.description) text_size: 2 * self.parent.width,self.parent.height - key_label.font_size @@ -75,6 +76,22 @@ size_hint: None, None size: 2 * self.parent.width - 2 * self.parent.line_width, self.parent.height - key_label.font_size +: + canvas.before: + Color: + rgba: 1, 0, 0, 0.9 + Rectangle: + pos: 0, 0 + size: self.width, self.height + size_hint: 1, 1 + color: 1, 1, 1, 1 + valign: "middle" + halign: "center" + font_name: "Ubuntu" + font_size: self.parent and 2 * self.parent.key_size or 42 + text_size: self.size + text: _("Focus lost!") + : canvas: Color: @@ -109,12 +126,13 @@ play_list_y: self.border play_list_x: self.action_list_width + self.key_list_width + 3 * self.border - max_height: 1.3 * math.ceil(2 * math.sqrt(self.key_size or 10)) + font_size: math.ceil(2 * math.sqrt(self.key_size or 10)) + max_height: 1.3 * self.font_size Label: id: mock_ubuntu_regular font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + font_size: self.parent.font_size color: 0, 0, 0, 0 text: "A" text_size: None, None @@ -144,6 +162,7 @@ size: self.parent.play_list_width, self.parent.play_list_height : + font_size: self.parent.font_size or 10 size_hint: None, None canvas: Color: @@ -155,7 +174,7 @@ id: key_list_first font_name: "Ubuntu" bold: True - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + font_size: self.parent.font_size color: 0, 0, 0, 1 text: self.parent.first_key text_size: None, None @@ -167,7 +186,7 @@ Label: id: key_list_second font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + font_size: self.parent.font_size color: 0, 0, 0, 1 text: self.parent.second_key text_size: None, None @@ -179,7 +198,7 @@ Label: id: key_list_third font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + font_size: self.parent.font_size color: 0, 0, 0, 0.75 text: self.parent.third_key text_size: None, None @@ -191,7 +210,7 @@ Label: id: key_list_rest font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.parent.key_size or 10)) + font_size: self.parent.font_size color: 0, 0, 0, 0.5 text: "\n".join(self.parent.keylist[3:]) text_size: None, None @@ -204,7 +223,7 @@ : size_hint: None, None labels_height: self.parent.max_height or 1 - font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + font_size: self.parent.font_size or 10 canvas: Color: rgba: 250./255, 250./255, 250./255, 1 @@ -261,7 +280,7 @@ : size_hint: None, None labels_height: self.parent.max_height or 1 - font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + font_size: self.parent.font_size or 10 canvas: Color: rgba: 250./255, 250./255, 250./255, 1 @@ -328,6 +347,7 @@ : size_hint: None, None key_size: 48 + font_size: self.parent.font_size key_sep: 2 key_pad_sep: 7 pad_x: 755 @@ -344,9 +364,9 @@ size: self.key_size / 3, self.key_size / 3 Label: font_name: "Ubuntu" - font_size: math.ceil(2 * math.sqrt(self.parent.key_size or 10)) + font_size: self.parent.font_size or 10 color: 0, 0, 0, 1 - text: "volume: {}%".format(self.parent.master_volume) + text: _("volume: {}%").format(self.parent.master_volume) valign: "top" size_hint: None, None size: self.texture_size[0], self.texture_size[1] @@ -591,6 +611,8 @@ key_sym: "^" row: 3 col: 12.5 + line_width: 1 + enabled: False Key: id: Key_36 key_code: 36 @@ -612,8 +634,6 @@ row: 4 col: 1 key_width: 1.75 - line_width: 1 - enabled: False Key: id: Key_113