diff options
-rw-r--r-- | src/editorui/paths.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/editorui/paths.py b/src/editorui/paths.py index 8cb6784..c5a51b6 100644 --- a/src/editorui/paths.py +++ b/src/editorui/paths.py @@ -22,7 +22,10 @@ class KPEditorNode(KPEditorItem): self.state = 0 - self.setPalette(QtGui.QPalette(QtGui.QColor(0,0,0,0))) + if not hasattr(KPEditorNode.ToggleButton, 'PALETTE'): + KPEditorNode.ToggleButton.PALETTE = QtGui.QPalette(Qt.transparent) + + self.setPalette(self.PALETTE) self.released.connect(self.toggle) @@ -38,14 +41,11 @@ class KPEditorNode(KPEditorItem): def paintEvent(self, event): painter = QtGui.QPainter(self) - painter.setBackgroundMode(Qt.TransparentMode) - painter.setBrush(QtGui.QColor(0,0,0,0)) - painter.setPen(QtGui.QColor(0,0,0,0)) - if self.isDown(): self.iconList[self.state].paint(painter, self.contentsRect(), Qt.AlignCenter, QtGui.QIcon.Disabled) else: self.iconList[self.state].paint(painter, self.contentsRect()) + painter.end() @@ -64,7 +64,13 @@ class KPEditorNode(KPEditorItem): QtGui.QSpinBox.__init__(self) self.setRange(1, 99) - self.setPalette(QtGui.QPalette(QtGui.QColor(0,0,0,0))) + + if not hasattr(KPEditorNode.LevelSlotSpinner, 'PALETTE'): + palette = QtGui.QApplication.palette(self) + palette.setColor(QtGui.QPalette.Window, Qt.transparent) + KPEditorNode.LevelSlotSpinner.PALETTE = palette + + self.setPalette(self.PALETTE) |