From 50ac9f36d6a74a17964bf3b0585402b988251afb Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Thu, 4 Dec 2014 18:19:05 -0300 Subject: [PATCH] Revert "Use consistent ellipsis mode" This reverts commit 0d428fc91367029da0e5500ab8a576506b3c0c13. This is not the right solution. We should ellipse at the end. The change was not discussed or approved. --- src/sugar3/graphics/palette.py | 6 ++---- src/sugar3/graphics/style.py | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py index be987181..7572ab1f 100644 --- a/src/sugar3/graphics/palette.py +++ b/src/sugar3/graphics/palette.py @@ -277,8 +277,7 @@ class Palette(PaletteWindow): self._secondary_label.set_max_width_chars( style.MENU_WIDTH_CHARS) self._secondary_label.set_line_wrap(True) - self._secondary_label.set_ellipsize( - style.DEFAULT_ELLIPSIS_MODE) + self._secondary_label.set_ellipsize(Pango.EllipsizeMode.END) self._secondary_label.set_lines(NO_OF_LINES) self._secondary_label.set_justify(Gtk.Justification.FILL) else: @@ -286,8 +285,7 @@ class Palette(PaletteWindow): body_width = NO_OF_LINES * style.MENU_WIDTH_CHARS body_width -= ELLIPSIS_LENGTH if len(label) > body_width: - label = label[0:style.DEFAULT_ELLIPSIS_CHARACTERS] + \ - '...' + label[-style.DEFAULT_ELLIPSIS_CHARACTERS:] + label = ' '.join(label[:body_width].split()[:-1]) + '...' label = textwrap.fill(label, width=style.MENU_WIDTH_CHARS) self._secondary_text = label diff --git a/src/sugar3/graphics/style.py b/src/sugar3/graphics/style.py index adc79778..54705e10 100644 --- a/src/sugar3/graphics/style.py +++ b/src/sugar3/graphics/style.py @@ -147,6 +147,3 @@ PALETTE_CURSOR_DISTANCE = zoom(10) TOOLBAR_ARROW_SIZE = zoom(24) MENU_WIDTH_CHARS = 60 - -DEFAULT_ELLIPSIS_MODE = Pango.EllipsizeMode.MIDDLE -DEFAULT_ELLIPSIS_CHARACTERS = 7