From 1094ab1ac48313b0c1caec15bc4fb6c584efa047 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 27 Jul 2016 00:21:31 +0200 Subject: [PATCH] Add border around running keys --- helpers/key.py | 12 ++++++++++++ music_sampler.kv | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) 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): 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] 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 @@ 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 -- 2.41.0