From adcdcbc41104004238a1412a50fc2b2e916f6c00 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 20 Oct 2005 09:49:28 +0000 Subject: [PATCH] color of tabs are now well handeled: when we receive a chat state we modify both gtk.STATE_NORMAL and gtk.STATE_ACTIVE color, so when we change the active tab, color is ok --- src/chat.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/chat.py b/src/chat.py index 4761d61d6..f419ebaee 100644 --- a/src/chat.py +++ b/src/chat.py @@ -208,20 +208,17 @@ class Chat: 'state_active_color') if color: color = gtk.gdk.colormap_get_system().alloc_color(color) - # The widget state depend on whether this tab is the "current" tab - if self.notebook.page_num(child) == self.notebook.get_current_page(): - widget_state = gtk.STATE_NORMAL - else: - widget_state = gtk.STATE_ACTIVE - if chatstate in ['inactive', 'gone']: - # Adjust color to be lighter against the darker inactive - # background - p = 0.4 - mask = 0 - color.red = int((color.red * p) + (mask * (1 - p))) - color.green = int((color.green * p) + (mask * (1 - p))) - color.blue = int((color.blue * p) + (mask * (1 - p))) - nickname.modify_fg(widget_state, color) + # We set the color for when it's the current tab or not + nickname.modify_fg(gtk.STATE_NORMAL, color) + if chatstate in ['inactive', 'gone']: + # Adjust color to be lighter against the darker inactive + # background + p = 0.4 + mask = 0 + color.red = int((color.red * p) + (mask * (1 - p))) + color.green = int((color.green * p) + (mask * (1 - p))) + color.blue = int((color.blue * p) + (mask * (1 - p))) + nickname.modify_fg(gtk.STATE_ACTIVE, color) elif self.widget_name == 'groupchat_window': nickname = hb.get_children()[0] close_button = hb.get_children()[1]