diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-08-01 21:25:32 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-08-08 20:36:48 +0200 |
commit | e682374d9f7eda4fd2c2701092470ee912e6c33b (patch) | |
tree | a65d25fc13b8be9e043f59ccbce7243a571c498c /grc/gui/Param.py | |
parent | e413d4a3e21969f5b0c7bf9c8f821efb14e4ffad (diff) |
grc: gtk3: fancier coloring for disabled and bypassed blocks
Diffstat (limited to 'grc/gui/Param.py')
-rw-r--r-- | grc/gui/Param.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/grc/gui/Param.py b/grc/gui/Param.py index fb62e3d9bb..ed5257ae69 100644 --- a/grc/gui/Param.py +++ b/grc/gui/Param.py @@ -67,11 +67,10 @@ class Param(_Param): hasattr(block, 'get_callbacks') and \ any(self.key in callback for callback in block._callbacks) - return '<span underline="{line}" foreground="{color}" font_desc="Sans 9">{label}</span>'.format( - line='low' if has_callback else 'none', - color='blue' if have_pending_changes else - 'black' if self.is_valid() else - 'red', + return '<span {underline} {foreground} font_desc="Sans 9">{label}</span>'.format( + underline='underline="low"' if has_callback else '', + foreground='foreground="blue"' if have_pending_changes else + 'foreground="red"' if not self.is_valid() else '', label=Utils.encode(self.name) ) @@ -157,8 +156,7 @@ class Param(_Param): Returns: a pango markup string """ - return '<span foreground="{color}" font_desc="{font}"><b>{label}:</b> {value}</span>'.format( - color='black' if self.is_valid() else 'red', font=Constants.PARAM_FONT, - label=Utils.encode(self.name), - value=Utils.encode(self.pretty_print().replace('\n', ' ')) + return '<span {foreground} font_desc="{font}"><b>{label}:</b> {value}</span>'.format( + foreground='foreground="red"' if not self.is_valid() else '', font=Constants.PARAM_FONT, + label=Utils.encode(self.name), value=Utils.encode(self.pretty_print().replace('\n', ' ')) ) |