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

gtklib: support stock icons in get_icon_pixbuf() function

Changeset 867bd8fc7a68

Parent f8c3be9f26f0

by Yuki KODAMA

Changes to one file · Browse files at 867bd8fc7a68 Showing diff from parent f8c3be9f26f0 Diff from another changeset...

 
127
128
129
 
130
131
132
133
134
135
136
137
 
 
 
 
 
 
 
 
 
 
138
139
140
 
127
128
129
130
131
 
 
 
 
 
 
 
132
133
134
135
136
137
138
139
140
141
142
143
144
@@ -127,14 +127,18 @@
  selection.select_iter(selected)   treeview.set_cursor(model.get_path(selected))   +_renderer = gtk.HBox()  def get_icon_pixbuf(name, size=gtk.ICON_SIZE_MENU): - path = paths.get_tortoise_icon(name) - if path: - try: - w, h = gtk.icon_size_lookup(size) - return gtk.gdk.pixbuf_new_from_file_at_size(path, w, h) - except: - pass + if name.startswith('gtk'): + return _renderer.render_icon(name, size) + else: + path = paths.get_tortoise_icon(name) + if path: + try: + w, h = gtk.icon_size_lookup(size) + return gtk.gdk.pixbuf_new_from_file_at_size(path, w, h) + except: + pass   return None    def get_icon_image(name):