diff options
author | Treeki <treeki@gmail.com> | 2011-11-21 20:44:46 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-11-21 20:44:46 +0100 |
commit | 4ddf1fc43e1c25e7b033cdebd0630e26f71ba81a (patch) | |
tree | 2dda4cc8e0591d22b3d3b25ff0abc2af9d9cc79a /src/editorui | |
parent | 375ba1236ebfdd6b5c9015e075ff215cfbd959c6 (diff) | |
download | koopatlas-4ddf1fc43e1c25e7b033cdebd0630e26f71ba81a.tar.gz koopatlas-4ddf1fc43e1c25e7b033cdebd0630e26f71ba81a.zip |
cleaned up palettes and stuff
Diffstat (limited to 'src/editorui')
-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) |