From a002886ef04400c8a719f5f5e63d7d39f06a47f2 Mon Sep 17 00:00:00 2001 From: jblum Date: Mon, 25 May 2009 16:38:58 +0000 Subject: color code refactoring git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11115 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/src/platforms/gui/Port.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'grc/src/platforms/gui/Port.py') 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(): -- cgit