#:import math math
-#:import h music_sampler
<Key>:
pad_col_sep: 0 if not self.pad_cols else self.parent.pad_x
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
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
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
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
size_hint: None, None
size: 2 * self.parent.width - 2 * self.parent.line_width, self.parent.height - key_label.font_size
+<UnfocusedOverlay>:
+ 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!")
+
<Screen>:
canvas:
Color:
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
- 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"
- 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
+ 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))
- 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: "Ubuntu"
- bold: True
- 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
size: self.parent.play_list_width, self.parent.play_list_height
<KeyList>:
+ font_size: self.parent.font_size or 10
size_hint: None, None
canvas:
Color:
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
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
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
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
<ActionList>:
size_hint: None, None
+ labels_height: self.parent.max_height or 1
+ font_size: self.parent.font_size or 10
canvas:
Color:
rgba: 250./255, 250./255, 250./255, 1
Rectangle:
pos: 0, 0
size: self.width, self.height
-
Label:
id: action_list_title
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.action_title
text_size: None, self.parent.height
valign: "top"
size_hint: None, None
size: self.texture_size[0], self.parent.height
- Label:
- id: action_list_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.action_list))
- text_size: None, self.parent.height
- halign: "left"
- valign: "top"
- size_hint: None, None
- size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
- Label:
- id: action_list_names
- font_name: "Ubuntu"
- 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
- halign: "left"
- valign: "top"
- size_hint: None, None
- pos: 15, self.y
- size: self.texture_size[0], self.parent.height - 3 * self.line_height * self.font_size
-
+ ActionListIcons:
+ font_size: self.parent.font_size
+ labels_height: self.parent.labels_height
+ orientation: 'lr-tb'
+ size_hint: 0.02, 0.9
+ pos_hint: { 'x': 0, 'top': 0.9 }
+ ActionListDescriptions:
+ font_size: self.parent.font_size
+ labels_height: self.parent.labels_height
+ orientation: 'lr-tb'
+ size_hint: 0.98, 0.9
+ pos_hint: { 'x': 0.02, 'top': 0.9 }
+
+<ActionListIcon>:
+ font_size: self.parent and self.parent.font_size or 10
+ height: self.parent and self.parent.labels_height or 0
+ font_name: "Symbola"
+ color: 0, 0, 0, 1
+ text_size: None, None
+ halign: "left"
+ size_hint: None, None
+ width: self.texture_size[0]
+
+<ActionListDescription>:
+ font_size: self.parent and self.parent.font_size or 10
+ height: self.parent and self.parent.labels_height or 0
+ font_name: "Ubuntu"
+ color: 0, 0, 0, 1
+ text_size: self.width, None
+ shorten: True
+ shorten_from: "right"
+ split_str: ""
+ halign: "left"
+ size_hint: 1, None
+
<PlayList>:
size_hint: None, None
+ labels_height: self.parent.max_height or 1
+ font_size: self.parent.font_size or 10
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:
+ font_size: self.parent.font_size
+ labels_height: self.parent.labels_height
+ orientation: 'lr-tb'
+ size_hint: 0.05, 1
+ pos_hints: { 'x': 0, 'top': 0 }
+ PlayListNames:
+ font_size: self.parent.font_size
+ labels_height: self.parent.labels_height
+ orientation: 'lr-tb'
+ pos_hint: { 'x': 0.05, 'bottom': 0 }
+ size_hint: 0.65, 1
+ PlayListTimes:
+ font_size: self.parent.font_size
+ labels_height: self.parent.labels_height
+ orientation: 'lr-tb'
+ pos_hint: { 'x': 0.7, 'bottom': 0 }
+ size_hint: 0.30, 1
+<PlayListIcon>:
+ font_size: self.parent and self.parent.font_size or 10
+ height: self.parent and self.parent.labels_height or 0
+ font_name: "Symbola"
+ color: 0, 0, 0, 1
+ text_size: None, None
+ halign: "left"
+ size_hint: None, None
+ width: self.texture_size[0]
+
+<PlayListName>:
+ font_size: self.parent and self.parent.font_size or 10
+ height: self.parent and self.parent.labels_height or 0
+ font_name: "Ubuntu"
+ color: 0, 0, 0, 1
+ text_size: self.width, None
+ shorten: True
+ shorten_from: "right"
+ split_str: ""
+ halign: "left"
+ size_hint: 1, None
+
+<PlayListTime>:
+ font_size: self.parent and self.parent.font_size or 10
+ height: self.parent and self.parent.labels_height or 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]
+
<Mapping>:
size_hint: None, None
key_size: 48
+ font_size: self.parent.font_size
key_sep: 2
key_pad_sep: 7
pad_x: 755
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]