Skip to content
Snippets Groups Projects
Commit 1c8b7c0a authored by dkirov's avatar dkirov
Browse files

cut multilined status for pygtk2.4

parent 7a267eb8
No related branches found
No related tags found
No related merge requests found
......@@ -390,7 +390,6 @@ class GroupchatWindow(chat.Chat):
# long subject makes window bigger than the screen
def _cut_if_long(str):
if len(str) > 80:
str = str
str = str[:77] + '...'
return str
if len(subject) > 80:
......
......@@ -135,7 +135,14 @@ class TabbedChatWindow(chat.Chat):
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
#FIXME: remove me when gtk24 is OLD
elif status is not None and len(status) > 50:
status = status[:47] + '...'
def _cut_if_long(str):
if len(str) > 50:
str = str[:47] + '...'
return str
if len(status) > 50:
status = map(lambda e: _cut_if_long(e), status.split('\n'))
status = reduce(lambda e, e1: e + '\n' + e1, status)
status = gtkgui_helpers.escape_for_pango_markup(status)
#FIXME: uncomment me when we support sending messages to specific resource
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment