aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-27 00:21:31 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-27 00:21:31 +0200
commit1094ab1ac48313b0c1caec15bc4fb6c584efa047 (patch)
tree73897466076bd6560dcb68fb6fdc4688f4692e4c
parentab47d2a1269c20d70f42942c4295c056544491f4 (diff)
downloadMusicSampler-1094ab1ac48313b0c1caec15bc4fb6c584efa047.tar.gz
MusicSampler-1094ab1ac48313b0c1caec15bc4fb6c584efa047.tar.zst
MusicSampler-1094ab1ac48313b0c1caec15bc4fb6c584efa047.zip
Add border around running keys
-rw-r--r--helpers/key.py12
-rw-r--r--music_sampler.kv1
2 files changed, 12 insertions, 1 deletions
diff --git a/helpers/key.py b/helpers/key.py
index 4ec08d1..9099f00 100644
--- a/helpers/key.py
+++ b/helpers/key.py
@@ -96,6 +96,18 @@ class Key(ButtonBehavior, Widget):
96 description = ListProperty([]) 96 description = ListProperty([])
97 state = StringProperty("") 97 state = StringProperty("")
98 98
99 def get_alias_line_color(self):
100 if self.is_loaded_running():
101 return [0, 0, 0, 1]
102 else:
103 return [120/255, 120/255, 120/255, 1]
104
105 def set_alias_line_color(self):
106 pass
107
108 line_color = AliasProperty(get_alias_line_color, set_alias_line_color,
109 bind=['state'])
110
99 def get_alias_color(self): 111 def get_alias_color(self):
100 if self.is_loaded_inactive(): 112 if self.is_loaded_inactive():
101 return [1, 1, 1, 1] 113 return [1, 1, 1, 1]
diff --git a/music_sampler.kv b/music_sampler.kv
index 3232956..882112d 100644
--- a/music_sampler.kv
+++ b/music_sampler.kv
@@ -8,7 +8,6 @@
8 y: (self.parent.top-self.parent.y) - (self.row) * self.parent.key_size - (self.row - 1) * self.parent.key_sep 8 y: (self.parent.top-self.parent.y) - (self.row) * self.parent.key_size - (self.row - 1) * self.parent.key_sep
9 x: (self.col - 1) * self.parent.key_size + int(self.col - 1) * self.parent.key_sep + self.pad_col_sep 9 x: (self.col - 1) * self.parent.key_size + int(self.col - 1) * self.parent.key_sep + self.pad_col_sep
10 size_hint: None, None 10 size_hint: None, None
11 line_color: 120/255, 120/255, 120/255, 1
12 enabled: True 11 enabled: True
13 line_width: 2 12 line_width: 2
14 row: 1 13 row: 1