[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/05: grc: inter-domain coloring for messa
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/05: grc: inter-domain coloring for messages |
Date: |
Tue, 13 Jan 2015 20:52:29 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 12119dca307a6f79c89f8c55d0b045b08fcd7c38
Author: Sebastian Koslowski <address@hidden>
Date: Thu Jan 8 14:37:57 2015 +0100
grc: inter-domain coloring for messages
---
grc/blocks/gr_message_domain.xml | 1 +
grc/gui/Connection.py | 21 +++++++++------------
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/grc/blocks/gr_message_domain.xml b/grc/blocks/gr_message_domain.xml
index c1eedb7..bc8add9 100644
--- a/grc/blocks/gr_message_domain.xml
+++ b/grc/blocks/gr_message_domain.xml
@@ -7,6 +7,7 @@
<domain>
<name>GR Message</name>
<key>gr_message</key>
+ <color>#000</color>
<multiple_sources>True</multiple_sources>
<connection>
<source_domain>gr_message</source_domain>
diff --git a/grc/gui/Connection.py b/grc/gui/Connection.py
index 84004f5..00343a2 100644
--- a/grc/gui/Connection.py
+++ b/grc/gui/Connection.py
@@ -83,18 +83,15 @@ class Connection(Element):
]
source_domain = self.get_source().get_domain()
sink_domain = self.get_sink().get_domain()
- if source_domain == GR_MESSAGE_DOMAIN:
- self.line_attributes[1] = gtk.gdk.LINE_ON_OFF_DASH
- else:
- self.line_attributes[1] = gtk.gdk.LINE_DOUBLE_DASH
- if source_domain != sink_domain:
- self.line_attributes[0] = 2
- get_domain_color = lambda d: Colors.get_color((
- self.get_parent().get_parent().get_domain(d) or {}
- ).get('color') or Colors.DEFAULT_DOMAIN_COLOR_CODE)
- self._color = get_domain_color(source_domain)
- self._bg_color = get_domain_color(sink_domain)
-
+ self.line_attributes[0] = 2 if source_domain != sink_domain else 0
+ self.line_attributes[1] = gtk.gdk.LINE_DOUBLE_DASH \
+ if not source_domain == sink_domain == GR_MESSAGE_DOMAIN \
+ else gtk.gdk.LINE_ON_OFF_DASH
+ get_domain_color = lambda d: Colors.get_color((
+ self.get_parent().get_parent().get_domain(d) or {}
+ ).get('color') or Colors.DEFAULT_DOMAIN_COLOR_CODE)
+ self._color = get_domain_color(source_domain)
+ self._bg_color = get_domain_color(sink_domain)
self._update_after_move()
def _update_after_move(self):