On Fri, Dec 17, 2010 at 11:34:08AM +0000, Aleksey Lim wrote: > By default, set palette title width to a half of screen widht.
s/widht/width > + CHAR_WIDTH = gtk.Label().create_pango_layout('W').get_pixel_size()[0] 'W' is chosen because it is the longest letter in your alphabet? > def __init__(self, label=None, accel_path=None, menu_after_content=False, > - text_maxlen=60, **kwargs): > + text_maxlen=-1, **kwargs): s/-1/None > + if text_maxlen < 0: if text_maxlen is None: > + text_maxlen = int(gtk.gdk.screen_width() * .5 / > Palette.CHAR_WIDTH) > + Multiply by 0.5 is not as easily understood as division by two. int(gtk.gdk.screen_width() / 2 / Palette.CHAR_WIDTH) -- James Cameron http://quozl.linux.org.au/ _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel