Hide status/topic label when there is nothing to show.
Disable empty tooltips.
This commit is contained in:
parent
89f778fb94
commit
5c92566a1d
|
@ -1205,12 +1205,10 @@ class ChatControl(ChatControlBase):
|
||||||
|
|
||||||
status = contact.status
|
status = contact.status
|
||||||
if status is not None:
|
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)
|
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
||||||
self.banner_status_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_reduced = helpers.reduce_chars_newlines(status, max_lines = 1)
|
||||||
status_escaped = gobject.markup_escape_text(status)
|
status_escaped = gobject.markup_escape_text(status_reduced)
|
||||||
|
|
||||||
font_attrs, font_attrs_small = self.get_font_attrs()
|
font_attrs, font_attrs_small = self.get_font_attrs()
|
||||||
st = gajim.config.get('displayed_chat_state_notifications')
|
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)
|
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
|
||||||
else:
|
else:
|
||||||
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
|
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:
|
else:
|
||||||
status_text = ''
|
status_text = ''
|
||||||
self.status_tooltip.disable()
|
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)
|
self.banner_status_label.set_markup(status_text)
|
||||||
# setup the label that holds name and jid
|
# setup the label that holds name and jid
|
||||||
|
|
|
@ -517,9 +517,13 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
# tooltip must always hold ALL the subject
|
# tooltip must always hold ALL the subject
|
||||||
self.subject_tooltip.set_tip(self.event_box, self.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:
|
else:
|
||||||
subject_text = ''
|
subject_text = ''
|
||||||
self.subject_tooltip.disable()
|
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)
|
self.banner_status_label.set_markup(subject_text)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue