Unread messages cause tab label to display bold; closes #1155
This commit is contained in:
parent
a2e68a1fc2
commit
fb31c2478c
17
src/chat.py
17
src/chat.py
|
@ -206,13 +206,14 @@ class Chat:
|
|||
# Update status images
|
||||
self.set_state_image(jid)
|
||||
|
||||
unread = ''
|
||||
num_unread = 0
|
||||
child = self.childs[jid]
|
||||
hb = self.notebook.get_tab_label(child).get_children()[0]
|
||||
if self.widget_name == 'tabbed_chat_window':
|
||||
nickname = hb.get_children()[1]
|
||||
close_button = hb.get_children()[2]
|
||||
|
||||
unread = ''
|
||||
num_unread = self.nb_unread[jid]
|
||||
if num_unread == 1 and not gajim.config.get('show_unread_tab_icon'):
|
||||
unread = '*'
|
||||
|
@ -222,9 +223,7 @@ class Chat:
|
|||
# Draw tab label using chatstate
|
||||
theme = gajim.config.get('roster_theme')
|
||||
color = None
|
||||
if unread and chatstate == 'active':
|
||||
color = gajim.config.get_per('themes', theme, 'state_unread_color')
|
||||
elif chatstate is not None:
|
||||
if chatstate is not None:
|
||||
if chatstate == 'composing':
|
||||
color = gajim.config.get_per('themes', theme,
|
||||
'state_composing_color')
|
||||
|
@ -235,10 +234,6 @@ class Chat:
|
|||
color = gajim.config.get_per('themes', theme, 'state_gone_color')
|
||||
elif chatstate == 'paused':
|
||||
color = gajim.config.get_per('themes', theme, '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:
|
||||
color = gajim.config.get_per('themes', theme, 'state_active_color')
|
||||
if color:
|
||||
|
@ -258,7 +253,6 @@ class Chat:
|
|||
nickname = hb.get_children()[0]
|
||||
close_button = hb.get_children()[1]
|
||||
|
||||
unread = ''
|
||||
has_focus = self.window.get_property('has-toplevel-focus')
|
||||
current_tab = (self.notebook.page_num(child) == self.notebook.get_current_page())
|
||||
color = None
|
||||
|
@ -289,7 +283,10 @@ class Chat:
|
|||
close_button.hide()
|
||||
|
||||
nickname.set_max_width_chars(10)
|
||||
nickname.set_text(unread + self.names[jid])
|
||||
lbl = self.names[jid]
|
||||
if num_unread:
|
||||
lbl = "<b>" + unread + lbl + "</b>"
|
||||
nickname.set_markup(lbl)
|
||||
|
||||
def get_message_type(self, jid):
|
||||
if self.widget_name == 'groupchat_window':
|
||||
|
|
|
@ -11326,7 +11326,7 @@ Status message</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
|
|
Loading…
Reference in New Issue