diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-08-20 17:55:40 +0200 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-08-20 17:55:40 +0200 |
commit | 00709699b217bc6b6b866ffad6d9a8c1e9497ae8 (patch) | |
tree | 2d14e7f26c79514c20524e2941eb7d5d225aa071 | |
parent | 8886123e78485e5c3d1edccaa35ce591e43dbbe5 (diff) |
grc: fix block height
-rw-r--r-- | grc/gui/Block.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py index a80b3d00eb..0ae624f94f 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 + |