Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/sugar/graphics/palette.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sugar/graphics/palette.py')
-rw-r--r--lib/sugar/graphics/palette.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sugar/graphics/palette.py b/lib/sugar/graphics/palette.py
index a24a806..3a27923 100644
--- a/lib/sugar/graphics/palette.py
+++ b/lib/sugar/graphics/palette.py
@@ -21,6 +21,7 @@ import gtk
import gobject
import time
import hippo
+import pango
from sugar.graphics import palettegroup
from sugar.graphics import animator
@@ -140,7 +141,8 @@ class Palette(gtk.Window):
gobject.TYPE_NONE, ([]))
}
- def __init__(self, label, accel_path=None, menu_after_content=False):
+ def __init__(self, label, accel_path=None, menu_after_content=False,
+ text_maxlen=0):
gtk.Window.__init__(self)
self.set_decorated(False)
@@ -178,6 +180,11 @@ class Palette(gtk.Window):
- 2*self.get_border_width())
self._label.set_alignment(0, 0.5)
self._label.set_padding(style.DEFAULT_SPACING, 0)
+
+ if text_maxlen > 0:
+ self._label.set_max_width_chars(text_maxlen)
+ self._label.set_ellipsize(pango.ELLIPSIZE_MIDDLE)
+
vbox.pack_start(self._label, False)
self._secondary_box = gtk.VBox()