Unselected tabs now show chatstate (was a FIXME)

This commit is contained in:
Travis Shirk 2005-09-10 19:23:57 +00:00
parent 3152050a81
commit 2e9c81aac7
1 changed files with 15 additions and 4 deletions

View File

@ -208,10 +208,21 @@ class Chat:
color = gajim.config.get_per('themes', theme, color = gajim.config.get_per('themes', theme,
'state_active_color') 'state_active_color')
if color: if color:
# FIXME: When tabs are in the "background" the color change has color = gtk.gdk.colormap_get_system().alloc_color(color)
# no affect # The widget state depend on whether this tab is the "current" tab
#print jid, chatstate, color if self.notebook.page_num(child) == self.notebook.get_current_page():
nickname.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) 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)
elif self.widget_name == 'groupchat_window': elif self.widget_name == 'groupchat_window':
nickname = hb.get_children()[0] nickname = hb.get_children()[0]
close_button = hb.get_children()[1] close_button = hb.get_children()[1]