From f717cd64cd53e5e0beb1bd698768cc8099dfacb6 Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Thu, 29 Mar 2012 20:54:55 +0800 Subject: Hob: some color style changes to make HobTabBar more close to visual design The change includes: - remove the colors which are not used - change the background of indicators to deep red - change the color style of the texts on HobTabBar, i.e., the tab text and the indicator background are gray when the tab is the current tab; the tab text is white and the indicator background is deep red when the tab is not the current tab. (Bitbake rev: 95acecbf50cee906dca4abd5ce758701e5761668) Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/hobcolor.py | 4 +--- bitbake/lib/bb/ui/crumbs/hobwidget.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs') diff --git a/bitbake/lib/bb/ui/crumbs/hobcolor.py b/bitbake/lib/bb/ui/crumbs/hobcolor.py index 74a9d46378..e10f546e52 100644 --- a/bitbake/lib/bb/ui/crumbs/hobcolor.py +++ b/bitbake/lib/bb/ui/crumbs/hobcolor.py @@ -25,13 +25,11 @@ class HobColors: PALE_RED = "#ffaaaa" GRAY = "#aaaaaa" LIGHT_GRAY = "#dddddd" - DEEP_GRAY = "#7c7c77" SLIGHT_DARK = "#5f5f5f" DARK = "#3c3b37" BLACK = "#000000" - LIGHT_ORANGE = "#f7a787" - YELLOW = "#ffff00" PALE_BLUE = "#53b8ff" + DEEP_RED = "#aa3e3e" OK = WHITE RUNNING = PALE_GREEN diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 413370e39c..8b176c661e 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py @@ -558,7 +558,10 @@ class HobTabBar(gtk.DrawingArea): off_y = (self.tab_height - fonth) / 2 x = child["x"] + off_x y = child["y"] + off_y - self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), pangolayout) + if not child == self.current_child: + self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), pangolayout, gtk.gdk.Color(HobColors.WHITE)) + else: + self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), pangolayout) def draw_toggled_tab(self, cr): if not self.current_child: @@ -616,7 +619,10 @@ class HobTabBar(gtk.DrawingArea): y = tab_y + self.tab_height/2 - dest_h/2 r = min(dest_w, dest_h)/2 - color = cr.set_source_color(gtk.gdk.color_parse(HobColors.ORANGE)) + if not child == self.current_child: + color = cr.set_source_color(gtk.gdk.color_parse(HobColors.DEEP_RED)) + else: + color = cr.set_source_color(gtk.gdk.color_parse(HobColors.GRAY)) # check round back area can contain the text or not back_round_can_contain_width = float(2 * r * 0.707) if float(textw) > back_round_can_contain_width: @@ -635,7 +641,7 @@ class HobTabBar(gtk.DrawingArea): x = x + (dest_w/2)-(textw/2) y = y + (dest_h/2) - (texth/2) cr.move_to(x, y) - self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), layout) + self.window.draw_layout(self.style.fg_gc[gtk.STATE_NORMAL], int(x), int(y), layout, gtk.gdk.Color(HobColors.WHITE)) def show_indicator_icon(self, child, number): child["indicator_show"] = True -- cgit v1.2.3-54-g00ecf