def _draw_pixmap(self, source, selected, synced, confined): color = QColor(0x99, 0x99, 0x99) if confined: color = QColor(0xDD, 0xDD, 0xDD) if selected: color = QColor(0xAA, 0xAA, 0xAA) elif selected: color = QColor(0x33, 0x33, 0x33) p = Pixmap(source) if p.isNull(): return p = Pixmap(p.scaled(120, 120, Qt.KeepAspectRatio)) p.replace_color(QColor(0, 0, 0), color) painter = QPainter(p) if confined: painter.drawPixmap(p.width() - 90, 0, 100, 100, IconTableItem.CONFINED_ICON) elif synced: painter.drawPixmap(p.width() - 90, 0, 100, 100, IconTableItem.SYNCED_ICON) else: painter.drawPixmap(p.width() - 90, 0, 100, 100, IconTableItem.UNSYNCED_ICON) painter.end() return p
def _draw_pixmap(self, source, selected, synced): color = QColor(0x33, 0x33, 0x33) if selected else QColor(0x99, 0x99, 0x99) p = Pixmap(source) p.replace_color(QColor(0, 0, 0), color) painter = QPainter(p) if synced: painter.drawPixmap(p.width() - 90, 0, 100, 100, IconTableItem.SYNCED_ICON) else: painter.drawPixmap(p.width() - 90, 0, 100, 100, IconTableItem.UNSYNCED_ICON) painter.end() return p