commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 03/22: grc: draw ports with custom domain d


From: git
Subject: [Commit-gnuradio] [gnuradio] 03/22: grc: draw ports with custom domain differently
Date: Tue, 23 Dec 2014 09:38:56 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit c4a7d780fc50a1556e2aaf02ec92ef91afbd3242
Author: Sebastian Koslowski <address@hidden>
Date:   Tue Dec 2 22:48:56 2014 +0100

    grc: draw ports with custom domain differently
---
 grc/gui/Block.py | 8 ++++----
 grc/gui/Port.py  | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 9b8d3b1..11c1caf 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -212,8 +212,11 @@ class Block(Element):
             gc: the graphics context
             window: the gtk window to draw on
         """
+        # draw ports
+        for port in self.get_ports_gui():
+            port.draw(gc, window)
+        # draw main block
         x, y = self.get_coordinate()
-        #draw main block
         Element.draw(
             self, gc, window, bg_color=self._bg_color,
             border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or
@@ -224,9 +227,6 @@ class Block(Element):
             window.draw_drawable(gc, self.horizontal_label, 0, 0, 
x+BLOCK_LABEL_PADDING, y+(self.H-self.label_height)/2, -1, -1)
         elif self.is_vertical():
             window.draw_drawable(gc, self.vertical_label, 0, 0, 
x+(self.H-self.label_height)/2, y+BLOCK_LABEL_PADDING, -1, -1)
-        #draw ports
-        for port in self.get_ports_gui():
-            port.draw(gc, window)
 
     def what_is_selected(self, coor, coor_m=None):
         """
diff --git a/grc/gui/Port.py b/grc/gui/Port.py
index 2a87573..5f8a733 100644
--- a/grc/gui/Port.py
+++ b/grc/gui/Port.py
@@ -22,6 +22,7 @@ from Constants import \
     PORT_SEPARATION, CONNECTOR_EXTENSION_MINIMAL, \
     CONNECTOR_EXTENSION_INCREMENT, \
     PORT_LABEL_PADDING, PORT_MIN_WIDTH, PORT_LABEL_HIDDEN_WIDTH, PORT_FONT
+from .. base.Constants import DEFAULT_DOMAIN
 import Utils
 import Actions
 import Colors
@@ -137,12 +138,15 @@ class Port(Element):
             gc: the graphics context
             window: the gtk window to draw on
         """
+        normal_line_width = gc.line_width  # todo: move line properties to 
Element
+        if self.get_domain() != DEFAULT_DOMAIN: gc.line_width = 2
         Element.draw(
             self, gc, window, bg_color=self._bg_color,
             border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or
                          self.get_parent().is_dummy_block() and 
Colors.MISSING_BLOCK_BORDER_COLOR or
                          Colors.BORDER_COLOR,
         )
+        gc.line_width = normal_line_width  # restore line style
         if not self._areas_list or self._label_hidden():
             return  # this port is either hidden (no areas) or folded (no 
label)
         X, Y = self.get_coordinate()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]