Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

gtklib: use get_icon_image()

Changeset 66d8a834a2da

Parent 1f0155f13789

by Yuki KODAMA

Changes to one file · Browse files at 66d8a834a2da Showing diff from parent 1f0155f13789 Diff from another changeset...

 
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
 
686
687
688
 
665
666
667
 
 
 
 
 
 
 
 
 
 
 
 
 
668
669
670
671
 
672
673
674
675
@@ -665,24 +665,11 @@
  """   icon: stock id or file name bundled in TortoiseHg.   """ - if icon.startswith('gtk'): - img = gtk.image_new_from_stock(icon, gtk.ICON_SIZE_MENU) - else: - img = gtk.Image() - filepath = paths.get_tortoise_icon(icon) - if filepath: - try: - size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU) - pixbuf = gtk.gdk.pixbuf_new_from_file_at_size( - filepath, *size) - img.set_from_pixbuf(pixbuf) - except: - pass   if toggle:   button = gtk.ToggleButton()   else:   button = gtk.Button() - button.set_image(img) + button.set_image(get_icon_image(icon))   button.set_relief(gtk.RELIEF_NONE)   button.set_focus_on_click(False)   if self.tooltips and tooltip: