def draw_dark_gradient(painter, delta, x1, x2, y1, y2): """ x2 must be greater than x1. """ if not Widgets.use_gradients: return orig_color = QColor(painter.pen().color()) diff = x2 - x1 delta = diff / (delta - 100) tally = 100 for i in range(diff): if not i % delta: tally += 1 color = orig_color.dark(tally) painter.setPen(color) painter.drawLine(x1+i, y1, x1+i, y2) Globals.psyco_bind(draw_dark_gradient)
rl += rcdelta gl += gcdelta bl += bcdelta p.setPen(QColor(rl>>16, gl>>16, bl>>16)) p.drawLine(0, y, pixmap.width()-1, y) else: for x in pixmap.width(): rl += rcdelta gl += gcdelta bl += bcdelta p.setPen(QColor(rl>>16, gl>>16, bl>>16)) p.drawLine(x, 0, x, pixmap.height()-1) return pixmap Globals.psyco_bind(gradient) class PixmapWidget: """ A widget that is drawn with pixmaps. """ cache = {} def cacheName(self, name): """ Cache all pixmaps whose names start with 'name'. """ if not name in PixmapWidget.cache: pixmaps = {} for entry in embedded_pixmaps.embed_image_vec: fn = entry[8] if fn.startswith(name):