X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=helpers%2Fkey.py;h=9099f00925b28e0764aa4eb6f6afa1743a595993;hb=1094ab1ac48313b0c1caec15bc4fb6c584efa047;hp=363e9ced7387577753113fda8a516b280abd9858;hpb=4b6d1836f3cc6e063bca3f4011ce5d17f733baa6;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git diff --git a/helpers/key.py b/helpers/key.py index 363e9ce..9099f00 100644 --- a/helpers/key.py +++ b/helpers/key.py @@ -70,7 +70,7 @@ class Key(ButtonBehavior, Widget): }, { 'trigger': 'reload', - 'source': 'loaded', + 'source': ['loaded','failed'], 'dest': 'configuring', 'after': 'key_loaded_callback' }, @@ -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] @@ -190,6 +202,7 @@ class Key(ButtonBehavior, Widget): def set_description(self, description): if description[0] is not None: self.description_title = str(description[0]) + self.description = [] for desc in description[1 :]: if desc is None: self.description.append("")