[Sugar-devel] [PATCH sugar-toolkit] Clipboard menu off screen #2201

James Cameron quozl at laptop.org
Fri Dec 17 17:24:14 EST 2010


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/


More information about the Sugar-devel mailing list