]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Add border around running keys
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 26 Jul 2016 22:21:31 +0000 (00:21 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 26 Jul 2016 22:21:31 +0000 (00:21 +0200)
helpers/key.py
music_sampler.kv

index 4ec08d19aa4c98185dcf9e12d2abb8a751c57d2c..9099f00925b28e0764aa4eb6f6afa1743a595993 100644 (file)
@@ -96,6 +96,18 @@ class Key(ButtonBehavior, Widget):
     description = ListProperty([])
     state = StringProperty("")
 
+    def get_alias_line_color(self):
+        if self.is_loaded_running():
+            return [0, 0, 0, 1]
+        else:
+            return [120/255, 120/255, 120/255, 1]
+
+    def set_alias_line_color(self):
+        pass
+
+    line_color = AliasProperty(get_alias_line_color, set_alias_line_color,
+            bind=['state'])
+
     def get_alias_color(self):
         if self.is_loaded_inactive():
             return [1, 1, 1, 1]
index 3232956a72041bd0e733ad101bbd0cb0152658df..882112d1c12a366326d67137d106f20442d3fd67 100644 (file)
@@ -8,7 +8,6 @@
   y: (self.parent.top-self.parent.y) - (self.row) * self.parent.key_size - (self.row - 1) * self.parent.key_sep
   x: (self.col - 1) * self.parent.key_size + int(self.col - 1) * self.parent.key_sep + self.pad_col_sep
   size_hint: None, None
-  line_color: 120/255, 120/255, 120/255, 1
   enabled: True
   line_width: 2
   row: 1