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

gdialog: use gtklib.get_icon_image()

Changeset 1f0155f13789

Parent 73e3ee617c88

by Yuki KODAMA

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

 
319
320
321
322
 
323
324
325
 
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
 
319
320
321
 
322
323
324
325
 
425
426
427
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
429
430
@@ -319,7 +319,7 @@
  if tip:   tbutton.set_tooltip(self.tooltips, tip)   if icon: - image = self.icon_from_name(icon) + image = gtklib.get_icon_image(icon)   tbutton.set_icon_widget(image)   tbutton.set_use_underline(True)   tbutton.set_label(label) @@ -425,22 +425,6 @@
  def setfocus(self, window, event):   self.lastpos = self.get_position()   - def icon_from_name(self, icon): - if icon.startswith('gtk'): - img = gtk.image_new_from_stock(icon, gtk.ICON_SIZE_MENU) - else: - img = gtk.Image() - ico = paths.get_tortoise_icon(icon) - if not ico: - return img - try: - width, height = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU) - buf = gtk.gdk.pixbuf_new_from_file_at_size(ico, width, height) - img.set_from_pixbuf(buf) - except: # don't let broken gtk+ to break dialogs - pass - return img -   def _setup_gtk(self):   self.set_title(self.get_title())   gtklib.set_tortoise_icon(self, self.get_icon())