diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
index 919721b..41c4d28 100644
a
|
b
|
class Palette(gtk.Window): |
145 | 145 | # DEPRECATED: label is passed with the primary-text property, accel_path |
146 | 146 | # is set via the invoker property, and menu_after_content is not used |
147 | 147 | def __init__(self, label=None, accel_path=None, menu_after_content=False, |
148 | | text_maxlen=0, **kwargs): |
| 148 | text_maxlen=999, **kwargs): |
149 | 149 | |
150 | 150 | self.palette_state = self.PRIMARY |
151 | 151 | |
… |
… |
class Palette(gtk.Window): |
178 | 178 | self._label = gtk.AccelLabel('') |
179 | 179 | self._label.set_alignment(0, 0.5) |
180 | 180 | |
| 181 | # The text_maxlen parameter defaults to 999. The reason for this is |
| 182 | # that the label will then request the correct size, while at the same |
| 183 | # time being able tel ellipsize correctly. Not setting maxlen would |
| 184 | # mean that the label requests a very small area, and the palette would |
| 185 | # not be wide enough. |
| 186 | # The size of the palette is clamped in do_size_request. |
181 | 187 | if text_maxlen > 0: |
182 | 188 | self._label.set_max_width_chars(text_maxlen) |
183 | 189 | self._label.set_ellipsize(pango.ELLIPSIZE_MIDDLE) |
… |
… |
class Palette(gtk.Window): |
467 | 473 | label_width, |
468 | 474 | self._full_request[0]) |
469 | 475 | |
| 476 | screen = self.get_screen() |
| 477 | screen_width = screen.get_width() |
| 478 | # Maximum width is two third of the screens width |
| 479 | requisition.width = min(requisition.width, screen_width * 2 / 3) |
| 480 | |
470 | 481 | def do_size_allocate(self, allocation): |
471 | 482 | gtk.Window.do_size_allocate(self, allocation) |
472 | 483 | |