diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2014-03-15 17:34:36 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2014-03-15 18:00:22 +0100 |
commit | 0ab8e89d5b4ef978b039fffbf95650292a85841f (patch) | |
tree | bb7c24b9cabb47ac6fc6591f3e40276b4a9862a9 | |
parent | bd857db80dab56523ecbc76886cd6fa5c1183890 (diff) |
grc: special colors for missing blocks
-rw-r--r-- | grc/gui/Block.py | 6 | ||||
-rw-r--r-- | grc/gui/Colors.py | 3 | ||||
-rw-r--r-- | 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 c35ce1c505..b2b391246e 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 5f92bb07a9..541d8db0b2 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 fe1dc5070a..e542797ea6 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 |