summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2015-09-25 13:48:50 +0200
committerSebastian Koslowski <koslowski@kit.edu>2015-09-26 14:28:33 +0200
commite7b408195e7ee58c3983e64d44b844f8332a05cd (patch)
treebe04fd524786a36d476fc100e369ab3596e45533
parentaaf5aa760a6876d7f5b878c563e002da19157cdb (diff)
grc: pad comment boxes like blocks
-rw-r--r--grc/gui/Block.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 94ed5802d1..7350e4bdfe 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -241,14 +241,17 @@ class Block(Element):
complexity=complexity,
font=BLOCK_FONT))
- # Setup the pixel map. Make sure that layout is valid
+ # Setup the pixel map. Make sure that layout not empty
width, height = layout.get_pixel_size()
- if layout and width > 0 and height > 0:
- pixmap = self.get_parent().new_pixmap(width, height)
+ if width and height:
+ padding = BLOCK_LABEL_PADDING
+ pixmap = self.get_parent().new_pixmap(width + 2 * padding,
+ height + 2 * padding)
gc = pixmap.new_gc()
gc.set_foreground(Colors.COMMENT_BACKGROUND_COLOR)
- pixmap.draw_rectangle(gc, True, 0, 0, width, height)
- pixmap.draw_layout(gc, 0, 0, layout)
+ pixmap.draw_rectangle(
+ gc, True, 0, 0, width + 2 * padding, height + 2 * padding)
+ pixmap.draw_layout(gc, padding, padding, layout)
self._comment_pixmap = pixmap
else:
self._comment_pixmap = None