[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 +
- [Commit-gnuradio] [gnuradio] branch master updated (84ce73a -> d07c986), git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 04/09: grc: fix block height,
git <=
- [Commit-gnuradio] [gnuradio] 09/09: Merge remote-tracking branch 'michaelld/fix_typo', git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 08/09: Merge remote-tracking branch 'gnuradio-wg-grc/grc_snap_blocks_to_grid', git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 02/09: grc: one preferences handler for all bools, git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 03/09: grc: toggle action and mod1 modifier for snap-to-grid, git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 07/09: cmake: remove verbose messages from UseSWIG., git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 01/09: grc: snap-to-grid (WIP), git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 05/09: cmake: fix typo in FindUHD., git, 2014/08/20
- [Commit-gnuradio] [gnuradio] 06/09: cmake: add compiler flag only if the compiler supports it, git, 2014/08/20