Fix for #854 and display chatstates when unread and no focus.
This commit is contained in:
parent
585a007c2a
commit
90cb506c3c
19
src/chat.py
19
src/chat.py
|
@ -164,8 +164,11 @@ class Chat:
|
||||||
'''redraw the label of the tab
|
'''redraw the label of the tab
|
||||||
if chatstate is given that means we have HE SENT US a chatstate'''
|
if chatstate is given that means we have HE SENT US a chatstate'''
|
||||||
unread = ''
|
unread = ''
|
||||||
if self.nb_unread[jid] > 1:
|
num_unread = self.nb_unread[jid]
|
||||||
unread = '[' + unicode(self.nb_unread[jid]) + '] '
|
if num_unread == 1 and not gajim.config.get('show_unread_tab_icon'):
|
||||||
|
unread = '* '
|
||||||
|
elif num_unread > 1:
|
||||||
|
unread = '[' + unicode(num_unread) + '] '
|
||||||
# Update status images
|
# Update status images
|
||||||
self.set_state_image(jid)
|
self.set_state_image(jid)
|
||||||
|
|
||||||
|
@ -185,12 +188,6 @@ class Chat:
|
||||||
if chatstate == 'composing':
|
if chatstate == 'composing':
|
||||||
color = gajim.config.get_per('themes', theme,
|
color = gajim.config.get_per('themes', theme,
|
||||||
'state_composing_color')
|
'state_composing_color')
|
||||||
elif unread and self.window.get_property('has-toplevel-focus'):
|
|
||||||
color = gajim.config.get_per('themes', theme,
|
|
||||||
'state_active_color')
|
|
||||||
elif unread:
|
|
||||||
color = gajim.config.get_per('themes', theme,
|
|
||||||
'state_unread_color')
|
|
||||||
elif chatstate == 'inactive':
|
elif chatstate == 'inactive':
|
||||||
color = gajim.config.get_per('themes', theme,
|
color = gajim.config.get_per('themes', theme,
|
||||||
'state_inactive_color')
|
'state_inactive_color')
|
||||||
|
@ -200,6 +197,12 @@ class Chat:
|
||||||
elif chatstate == 'paused':
|
elif chatstate == 'paused':
|
||||||
color = gajim.config.get_per('themes', theme,
|
color = gajim.config.get_per('themes', theme,
|
||||||
'state_paused_color')
|
'state_paused_color')
|
||||||
|
elif unread and self.window.get_property('has-toplevel-focus'):
|
||||||
|
color = gajim.config.get_per('themes', theme,
|
||||||
|
'state_active_color')
|
||||||
|
elif unread:
|
||||||
|
color = gajim.config.get_per('themes', theme,
|
||||||
|
'state_unread_color')
|
||||||
else:
|
else:
|
||||||
color = gajim.config.get_per('themes', theme,
|
color = gajim.config.get_per('themes', theme,
|
||||||
'state_active_color')
|
'state_active_color')
|
||||||
|
|
|
@ -148,6 +148,7 @@ class Config:
|
||||||
'avatar_height': [opt_int, 52],
|
'avatar_height': [opt_int, 52],
|
||||||
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This option make sense only if trayicon is used.')],
|
'quit_on_roster_x_button': [opt_bool, False, _('If True, quits Gajim when X button of Window Manager is clicked. This option make sense only if trayicon is used.')],
|
||||||
'set_xmpp://_handler_everytime': [opt_bool, False, _('If True, Gajim registers for xmpp:// on each startup.')],
|
'set_xmpp://_handler_everytime': [opt_bool, False, _('If True, Gajim registers for xmpp:// on each startup.')],
|
||||||
|
'show_unread_tab_icon': [opt_bool, False, _('If True, Gajim will display an icon on each tab containing unread messages. Depending on the theme, this icon may be animated.')],
|
||||||
}
|
}
|
||||||
|
|
||||||
__options_per_key = {
|
__options_per_key = {
|
||||||
|
|
|
@ -256,7 +256,7 @@ timestamp, contact):
|
||||||
banner_status_image.set_from_pixbuf(scaled_pix)
|
banner_status_image.set_from_pixbuf(scaled_pix)
|
||||||
|
|
||||||
# Set tab image; unread messages show the 'message' image
|
# Set tab image; unread messages show the 'message' image
|
||||||
if self.nb_unread[jid]:
|
if self.nb_unread[jid] and gajim.config.get('show_unread_tab_icon'):
|
||||||
tab_image = state_images['message']
|
tab_image = state_images['message']
|
||||||
else:
|
else:
|
||||||
tab_image = banner_image
|
tab_image = banner_image
|
||||||
|
|
Loading…
Reference in New Issue