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 <shane.wang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ad8fe62cee
commit
f717cd64cd
|
@ -25,13 +25,11 @@ class HobColors:
|
||||||
PALE_RED = "#ffaaaa"
|
PALE_RED = "#ffaaaa"
|
||||||
GRAY = "#aaaaaa"
|
GRAY = "#aaaaaa"
|
||||||
LIGHT_GRAY = "#dddddd"
|
LIGHT_GRAY = "#dddddd"
|
||||||
DEEP_GRAY = "#7c7c77"
|
|
||||||
SLIGHT_DARK = "#5f5f5f"
|
SLIGHT_DARK = "#5f5f5f"
|
||||||
DARK = "#3c3b37"
|
DARK = "#3c3b37"
|
||||||
BLACK = "#000000"
|
BLACK = "#000000"
|
||||||
LIGHT_ORANGE = "#f7a787"
|
|
||||||
YELLOW = "#ffff00"
|
|
||||||
PALE_BLUE = "#53b8ff"
|
PALE_BLUE = "#53b8ff"
|
||||||
|
DEEP_RED = "#aa3e3e"
|
||||||
|
|
||||||
OK = WHITE
|
OK = WHITE
|
||||||
RUNNING = PALE_GREEN
|
RUNNING = PALE_GREEN
|
||||||
|
|
|
@ -558,7 +558,10 @@ class HobTabBar(gtk.DrawingArea):
|
||||||
off_y = (self.tab_height - fonth) / 2
|
off_y = (self.tab_height - fonth) / 2
|
||||||
x = child["x"] + off_x
|
x = child["x"] + off_x
|
||||||
y = child["y"] + off_y
|
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):
|
def draw_toggled_tab(self, cr):
|
||||||
if not self.current_child:
|
if not self.current_child:
|
||||||
|
@ -616,7 +619,10 @@ class HobTabBar(gtk.DrawingArea):
|
||||||
y = tab_y + self.tab_height/2 - dest_h/2
|
y = tab_y + self.tab_height/2 - dest_h/2
|
||||||
|
|
||||||
r = min(dest_w, 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
|
# check round back area can contain the text or not
|
||||||
back_round_can_contain_width = float(2 * r * 0.707)
|
back_round_can_contain_width = float(2 * r * 0.707)
|
||||||
if float(textw) > back_round_can_contain_width:
|
if float(textw) > back_round_can_contain_width:
|
||||||
|
@ -635,7 +641,7 @@ class HobTabBar(gtk.DrawingArea):
|
||||||
x = x + (dest_w/2)-(textw/2)
|
x = x + (dest_w/2)-(textw/2)
|
||||||
y = y + (dest_h/2) - (texth/2)
|
y = y + (dest_h/2) - (texth/2)
|
||||||
cr.move_to(x, y)
|
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):
|
def show_indicator_icon(self, child, number):
|
||||||
child["indicator_show"] = True
|
child["indicator_show"] = True
|
||||||
|
|
Loading…
Reference in New Issue