commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 04/09: grc: fix block height


From: git
Subject: [Commit-gnuradio] [gnuradio] 04/09: grc: fix block height
Date: Wed, 20 Aug 2014 20:18:47 +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 00709699b217bc6b6b866ffad6d9a8c1e9497ae8
Author: Sebastian Koslowski <address@hidden>
Date:   Wed Aug 20 17:55:40 2014 +0200

    grc: fix block height
---
 grc/gui/Block.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index a80b3d0..0ae624f 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -183,13 +183,17 @@ class Block(Element):
             Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
         #calculate width and height needed
         self.W = self.label_width + 2*BLOCK_LABEL_PADDING
+        def get_min_height_for_ports():
+            visible_ports = filter(lambda p: not p.get_hide(), ports)
+            H = 2*PORT_BORDER_SEPARATION + len(visible_ports) * PORT_SEPARATION
+            if visible_ports: H -= ports[0].H
+            return H
         self.H = max(*(
             [  # labels
                 self.label_height + 2 * BLOCK_LABEL_PADDING
             ] +
             [  # ports
-                PORT_SEPARATION * len(filter(lambda p: not p.get_hide(), 
ports))
-                for ports in (self.get_sources_gui(), self.get_sinks_gui())
+                get_min_height_for_ports() for ports in 
(self.get_sources_gui(), self.get_sinks_gui())
             ] +
             [  # bus ports only
                 4 * PORT_BORDER_SEPARATION +



reply via email to

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