diff options
author | jblum | 2009-05-25 16:38:58 +0000 |
---|---|---|
committer | jblum | 2009-05-25 16:38:58 +0000 |
commit | a002886ef04400c8a719f5f5e63d7d39f06a47f2 (patch) | |
tree | 9a012ce90efc8ff93c2d7260447d61753bf4f256 /grc/src/platforms/gui/Port.py | |
parent | 017b9b15193d2278d67439bb863de6c5dc6a4989 (diff) | |
download | gnuradio-a002886ef04400c8a719f5f5e63d7d39f06a47f2.tar.gz gnuradio-a002886ef04400c8a719f5f5e63d7d39f06a47f2.tar.bz2 gnuradio-a002886ef04400c8a719f5f5e63d7d39f06a47f2.zip |
color code refactoring
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11115 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/gui/Port.py')
-rw-r--r-- | grc/src/platforms/gui/Port.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/grc/src/platforms/gui/Port.py b/grc/src/platforms/gui/Port.py index a763e406d..d1f36f8b9 100644 --- a/grc/src/platforms/gui/Port.py +++ b/grc/src/platforms/gui/Port.py @@ -84,7 +84,7 @@ class Port(Element): def _create_labels(self): """Create the labels for the socket.""" - self.BG_color = Colors.get_color(self.get_color()) + self._bg_color = Colors.get_color(self.get_color()) #create the layout layout = gtk.DrawingArea().create_pango_layout('') layout.set_markup(Utils.parse_template(PORT_MARKUP_TMPL, port=self)) @@ -93,9 +93,8 @@ class Port(Element): #create the pixmap pixmap = self.get_parent().get_parent().new_pixmap(self.w, self.h) gc = pixmap.new_gc() - gc.foreground = self.BG_color + gc.set_foreground(self._bg_color) pixmap.draw_rectangle(gc, True, 0, 0, self.w, self.h) - gc.foreground = Colors.TXT_COLOR pixmap.draw_layout(gc, 0, 0, layout) #create the images self.horizontal_label = image = pixmap.get_image(0, 0, self.w, self.h) @@ -110,8 +109,10 @@ class Port(Element): @param gc the graphics context @param window the gtk window to draw on """ - Element.draw(self, gc, window, BG_color=self.BG_color) - gc.foreground = Colors.TXT_COLOR + Element.draw( + self, gc, window, bg_color=self._bg_color, + border_color=self.is_highlighted() and Colors.HIGHLIGHT_COLOR or Colors.BORDER_COLOR, + ) X,Y = self.get_coordinate() (x,y),(w,h) = self.areas_dict[self.get_rotation()][0] #use the first area's sizes to place the labels if self.is_horizontal(): |