[Dextrose] [PATCH] Clipboard menu off screen fixed for long text strings(SL #2201)

Mukul Gupta mukul at seeta.in
Tue Oct 26 16:13:43 EDT 2010


Team,

Unfortunately, I had not mentioned the version number in the previous patch.
I apologize for the mistake. I am correcting the indentation with adding the
versions correctly.

Regards,

Mukul Gupta
Research Engineer, SEETA

On Wed, Oct 27, 2010 at 1:22 AM, Mukul Gupta <mukul at seeta.in> wrote:

> Changing maximum text length to a suitable value in clipboardmenu
> which is dependent on the screen width and pixel size of
> characters
> ---
>  src/jarabe/frame/clipboardmenu.py |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/jarabe/frame/clipboardmenu.py
> b/src/jarabe/frame/clipboardmenu.py
> index b998110..b0d141d 100644
> --- a/src/jarabe/frame/clipboardmenu.py
> +++ b/src/jarabe/frame/clipboardmenu.py
> @@ -38,7 +38,10 @@ from jarabe.model import bundleregistry
>  class ClipboardMenu(Palette):
>
>     def __init__(self, cb_object):
> -        Palette.__init__(self, text_maxlen=100)
> +        char_lable = gtk.Label()
> +        create_layout = char_lable.create_pango_layout("W")
> +        Palette.__init__(self, text_maxlen=int(0.75 * gtk.gdk.screen_width
> +        () / create_layout.get_pixel_size()[0]))
>
>         self._cb_object = cb_object
>
> --
> 1.7.0.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20101027/15bb3b5f/attachment.html>


More information about the Dextrose mailing list