Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

qtlib: add getpixmap() utility function

Changeset 6d70ca99b9da

Parent e8eb472e138f

by Yuki KODAMA

Changes to one file · Browse files at 6d70ca99b9da Showing diff from parent e8eb472e138f Diff from another changeset...

 
165
166
167
 
 
 
 
 
 
 
 
 
 
 
168
169
170
 
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
@@ -165,6 +165,17 @@
  _iconcache[name] = icon   return icon   +_pixmapcache = {} + +def getpixmap(name, width=16, height=16): + key = '%s_%sx%s' % (name, width, height) + try: + return _pixmapcache[key] + except KeyError: + pixmap = geticon(name).pixmap(width, height) + _pixmapcache[key] = pixmap + return pixmap +  def CommonMsgBox(icon, title, main, text='', buttons=QtGui.QMessageBox.Close,   parent=None):   msg = QtGui.QMessageBox(parent)