diff --git a/src/chat_control.py b/src/chat_control.py index e27a64c92..68a5cbe11 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -133,6 +133,7 @@ class ChatControlBase(MessageControl): # Create banner and connect signals widget = self.xml.get_widget('banner_eventbox') + widget.set_property('height-request', gajim.config.get('chat_avatar_height')) id = widget.connect('button-press-event', self._on_banner_eventbox_button_press_event) self.handlers[id] = widget @@ -1117,6 +1118,8 @@ class ChatControl(ChatControlBase): jid = contact.jid banner_name_label = self.xml.get_widget('banner_name_label') + banner_eventbox = self.xml.get_widget('banner_eventbox') + name = contact.get_shown_name() if self.resource: name += '/' + self.resource @@ -1143,8 +1146,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) - status = helpers.reduce_chars_newlines(status, max_lines = 2) + status = helpers.reduce_chars_newlines(status, max_lines = 1) status_escaped = gobject.markup_escape_text(status) font_attrs, font_attrs_small = self.get_font_attrs() @@ -1177,9 +1182,6 @@ class ChatControl(ChatControlBase): if status_escaped: label_text += '\n%s' %\ (font_attrs_small, status_escaped) - banner_eventbox = self.xml.get_widget('banner_eventbox') - self.status_tooltip.set_tip(banner_eventbox, status) - self.status_tooltip.enable() else: self.status_tooltip.disable() # setup the label that holds name and jid diff --git a/src/common/helpers.py b/src/common/helpers.py index 2b6f7b5cc..cc855c597 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -871,6 +871,8 @@ def reduce_chars_newlines(text, max_chars = 0, max_lines = 0): lines = map(lambda e: _cut_if_long(e), lines) if lines: reduced_text = reduce(lambda e, e1: e + '\n' + e1, lines) + if reduced_text != text: + reduced_text += '...' else: reduced_text = '' return reduced_text