[prev in list] [next in list] [prev in thread] [next in thread]
List: gnuradio-commit
Subject: [Commit-gnuradio] [gnuradio] 02/05: grc: align block sizes to grid
From: git () gnuradio ! org
Date: 2016-04-28 0:13:12
Message-ID: 20160428001312.E36771A82A5 () hertz ! gnuradio ! org
[Download RAW message or body]
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit ec7ef7fe2942bf73e7ff9166530d25dd605a1fce
Author: Sebastian Koslowski <koslowski@kit.edu>
Date: Wed Apr 27 13:15:11 2016 +0200
grc: align block sizes to grid
---
grc/gui/Block.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 9513531..815982c 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -242,14 +242,15 @@ class Block(Element, _Block):
self.vertical_label = self.get_parent().new_pixmap(height, width)
Utils.rotate_pixmap(gc, self.horizontal_label, self.vertical_label)
#calculate width and height needed
- self.W = self.label_width + 2 * BLOCK_LABEL_PADDING
+ 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(
+ min_height = 2*PORT_BORDER_SEPARATION + len(visible_ports) * PORT_SEPARATION
+ if visible_ports:
+ min_height -= ports[0].H
+ return min_height
+ H = max(
[ # labels
self.label_height + 2 * BLOCK_LABEL_PADDING
] +
@@ -262,6 +263,7 @@ class Block(Element, _Block):
for ports in (self.get_sources_gui(), self.get_sinks_gui())
]
)
+ self.W, self.H = Utils.align_to_grid((W, H))
self.has_busses = [
any(port.get_type() == 'bus' for port in ports)
for ports in (self.get_sources_gui(), self.get_sinks_gui())
_______________________________________________
Commit-gnuradio mailing list
Commit-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/commit-gnuradio
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic