Unselected tabs now show chatstate (was a FIXME)
This commit is contained in:
parent
3152050a81
commit
2e9c81aac7
19
src/chat.py
19
src/chat.py
|
@ -208,10 +208,21 @@ class Chat:
|
|||
color = gajim.config.get_per('themes', theme,
|
||||
'state_active_color')
|
||||
if color:
|
||||
# FIXME: When tabs are in the "background" the color change has
|
||||
# no affect
|
||||
#print jid, chatstate, color
|
||||
nickname.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse(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)
|
||||
elif self.widget_name == 'groupchat_window':
|
||||
nickname = hb.get_children()[0]
|
||||
close_button = hb.get_children()[1]
|
||||
|
|
Loading…
Reference in New Issue