SourceForge: tortoisehg/tortoisehg: changeset 4032:5d7e27ba22b8
gdialog: Make tool menu icons proper size
authorPeer Sommerlund <peso@users.sourceforge.net>
Tue Sep 15 14:21:57 2009 +0200 (2 months ago)
changeset 40325d7e27ba22b8
parent 40312e37faf4eba4
child 4033c19b2e2c6dfa
gdialog: Make tool menu icons proper size
tortoisehg/hgtk/gdialog.py
     1.1 --- a/tortoisehg/hgtk/gdialog.py	Tue Sep 15 14:40:28 2009 +0200
     1.2 +++ b/tortoisehg/hgtk/gdialog.py	Tue Sep 15 14:21:57 2009 +0200
     1.3 @@ -454,7 +454,10 @@
     1.4                              else:
     1.5                                  img = gtk.Image()
     1.6                                  ico = paths.get_tortoise_icon(icon_or_var)
     1.7 -                                if ico: img.set_from_file(ico)
     1.8 +                                if ico:
     1.9 +                                    width, height = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
    1.10 +                                    pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(ico, width, height)
    1.11 +                                    img.set_from_pixbuf(pixbuf)
    1.12                              item.set_image(img)
    1.13                          else:
    1.14                              item = gtk.MenuItem(name)