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

This commit is contained in:
Yann Leboulanger 2005-10-20 09:49:28 +00:00
parent a7300534f8
commit adcdcbc411
1 changed files with 11 additions and 14 deletions

View File

@ -208,11 +208,8 @@ 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
# 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
@ -221,7 +218,7 @@ class Chat:
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)
nickname.modify_fg(gtk.STATE_ACTIVE, color)
elif self.widget_name == 'groupchat_window':
nickname = hb.get_children()[0]
close_button = hb.get_children()[1]