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

Disable empty tooltips.
This commit is contained in:
Stephan Erb 2007-11-29 20:33:10 +00:00
parent 89f778fb94
commit 5c92566a1d
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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)