commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 12/24: grc: special colors for missing bloc


From: git
Subject: [Commit-gnuradio] [gnuradio] 12/24: grc: special colors for missing blocks
Date: Tue, 18 Mar 2014 17:51:41 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit 0ab8e89d5b4ef978b039fffbf95650292a85841f
Author: Sebastian Koslowski <address@hidden>
Date:   Sat Mar 15 17:34:36 2014 +0100

    grc: special colors for missing blocks
---
 grc/gui/Block.py  | 6 ++++--
 grc/gui/Colors.py | 3 +++
 grc/gui/Port.py   | 3 ++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/grc/gui/Block.py b/grc/gui/Block.py
index c35ce1c..b2b3912 100644
--- a/grc/gui/Block.py
+++ b/grc/gui/Block.py
@@ -131,7 +131,8 @@ class Block(Element):
     def create_labels(self):
         """Create the labels for the signal block."""
         Element.create_labels(self)
-        self._bg_color = self.get_enabled() and Colors.BLOCK_ENABLED_COLOR or 
Colors.BLOCK_DISABLED_COLOR
+        self._bg_color = self.is_dummy_block() and 
Colors.MISSING_BLOCK_BACKGROUND_COLOR or \
+                         self.get_enabled() and Colors.BLOCK_ENABLED_COLOR or 
Colors.BLOCK_DISABLED_COLOR
         layouts = list()
         #create the main layout
         layout = gtk.DrawingArea().create_pango_layout('')
@@ -194,7 +195,8 @@ class Block(Element):
         #draw main block
         Element.draw(
             self, gc, window, bg_color=self._bg_color,
-            border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or 
Colors.BORDER_COLOR,
+            border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or
+                         self.is_dummy_block() and 
Colors.MISSING_BLOCK_BORDER_COLOR or Colors.BORDER_COLOR,
         )
         #draw label image
         if self.is_horizontal():
diff --git a/grc/gui/Colors.py b/grc/gui/Colors.py
index 5f92bb0..541d8db 100644
--- a/grc/gui/Colors.py
+++ b/grc/gui/Colors.py
@@ -26,6 +26,9 @@ try:
 
     HIGHLIGHT_COLOR = get_color('#00FFFF')
     BORDER_COLOR = get_color('black')
+    # missing blocks stuff
+    MISSING_BLOCK_BACKGROUND_COLOR = get_color('#FFF2F2')
+    MISSING_BLOCK_BORDER_COLOR = get_color('red')
     #param entry boxes
     PARAM_ENTRY_TEXT_COLOR = get_color('black')
     ENTRYENUM_CUSTOM_COLOR = get_color('#EEEEEE')
diff --git a/grc/gui/Port.py b/grc/gui/Port.py
index fe1dc50..e542797 100644
--- a/grc/gui/Port.py
+++ b/grc/gui/Port.py
@@ -126,7 +126,8 @@ class Port(Element):
         """
         Element.draw(
             self, gc, window, bg_color=self._bg_color,
-            border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or 
Colors.BORDER_COLOR,
+            border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or
+                         self.get_parent().is_dummy_block() and 
Colors.MISSING_BLOCK_BORDER_COLOR or Colors.BORDER_COLOR,
         )
         X,Y = self.get_coordinate()
         (x,y),(w,h) = self._areas_list[0] #use the first area's sizes to place 
the labels



reply via email to

[Prev in Thread] Current Thread [Next in Thread]