Commit 5c92566a authored by steve-e's avatar steve-e

Hide status/topic label when there is nothing to show.

Disable empty tooltips.
parent 89f778fb
......@@ -1205,12 +1205,10 @@ class ChatControl(ChatControlBase):
status = contact.status
if status is not None:
self.status_tooltip.set_tip(banner_eventbox, status)
self.status_tooltip.enable()
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
self.banner_status_label.set_ellipsize(pango.ELLIPSIZE_END)
status = helpers.reduce_chars_newlines(status, max_lines = 1)
status_escaped = gobject.markup_escape_text(status)
status_reduced = helpers.reduce_chars_newlines(status, max_lines = 1)
status_escaped = gobject.markup_escape_text(status_reduced)
font_attrs, font_attrs_small = self.get_font_attrs()
st = gajim.config.get('displayed_chat_state_notifications')
......@@ -1246,9 +1244,14 @@ class ChatControl(ChatControlBase):
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
else:
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
self.status_tooltip.set_tip(banner_eventbox, status)
self.banner_status_label.show()
self.banner_status_label.set_no_show_all(False)
else:
status_text = ''
self.status_tooltip.disable()
self.banner_status_label.hide()
self.banner_status_label.set_no_show_all(True)
self.banner_status_label.set_markup(status_text)
# setup the label that holds name and jid
......
......@@ -517,9 +517,13 @@ class GroupchatControl(ChatControlBase):
# tooltip must always hold ALL the subject
self.subject_tooltip.set_tip(self.event_box, self.subject)
self.banner_status_label.show()
self.banner_status_label.set_no_show_all(False)
else:
subject_text = ''
self.subject_tooltip.disable()
self.banner_status_label.hide()
self.banner_status_label.set_no_show_all(True)
self.banner_status_label.set_markup(subject_text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment