[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/05: grc: hide comment for disabled block
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/05: grc: hide comment for disabled blocks; add colored background |
Date: |
Sat, 4 Apr 2015 17:45:41 +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 ad0eb4512d6cc4a5f35c8ac9117aa6ee71fee1cf
Author: Sebastian Koslowski <address@hidden>
Date: Thu Apr 2 19:27:38 2015 +0200
grc: hide comment for disabled blocks; add colored background
---
grc/gui/Block.py | 3 +--
grc/gui/Colors.py | 1 +
grc/gui/FlowGraph.py | 7 +++----
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index 5d3ae45..60f19fc 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -217,14 +217,13 @@ class Block(Element):
width, height = layout.get_pixel_size()
pixmap = self.get_parent().new_pixmap(width, height)
gc = pixmap.new_gc()
- gc.set_foreground(Colors.FLOWGRAPH_BACKGROUND_COLOR)
+ gc.set_foreground(Colors.COMMENT_BACKGROUND_COLOR)
pixmap.draw_rectangle(gc, True, 0, 0, width, height)
pixmap.draw_layout(gc, 0, 0, layout)
self._comment_pixmap = pixmap
else:
self._comment_pixmap = None
-
def draw(self, gc, window):
"""
Draw the signal block with label and inputs/outputs.
diff --git a/grc/gui/Colors.py b/grc/gui/Colors.py
index 7430705..f64106b 100644
--- a/grc/gui/Colors.py
+++ b/grc/gui/Colors.py
@@ -34,6 +34,7 @@ try:
ENTRYENUM_CUSTOM_COLOR = get_color('#EEEEEE')
#flow graph color constants
FLOWGRAPH_BACKGROUND_COLOR = get_color('#FFF9FF')
+ COMMENT_BACKGROUND_COLOR = get_color('#F3F3F3')
#block color constants
BLOCK_ENABLED_COLOR = get_color('#F1ECFF')
BLOCK_DISABLED_COLOR = get_color('#CCCCCC')
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 51b522a..97f814f 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -281,12 +281,10 @@ class FlowGraph(Element):
gc.set_foreground(Colors.FLOWGRAPH_BACKGROUND_COLOR)
window.draw_rectangle(gc, True, 0, 0, W, H)
# draw comments first
- hide_disabled_blocks = Actions.TOGGLE_HIDE_DISABLED_BLOCKS.get_active()
if Actions.TOGGLE_SHOW_BLOCK_COMMENTS.get_active():
for block in self.get_blocks():
- if hide_disabled_blocks and not block.get_enabled():
- continue # skip hidden disabled block comments
- block.draw_comment(gc, window)
+ if block.get_enabled():
+ block.draw_comment(gc, window)
#draw multi select rectangle
if self.mouse_pressed and (not self.get_selected_elements() or
self.get_ctrl_mask()):
#coordinates
@@ -301,6 +299,7 @@ class FlowGraph(Element):
gc.set_foreground(Colors.BORDER_COLOR)
window.draw_rectangle(gc, False, x, y, w, h)
#draw blocks on top of connections
+ hide_disabled_blocks = Actions.TOGGLE_HIDE_DISABLED_BLOCKS.get_active()
for element in self.get_connections() + self.get_blocks():
if hide_disabled_blocks and not element.get_enabled():
continue # skip hidden disabled blocks and connections