--- a/IconEditor/IconEditorPalette.py Tue Oct 15 22:03:54 2013 +0200 +++ b/IconEditor/IconEditorPalette.py Fri Oct 18 23:00:41 2013 +0200 @@ -10,9 +10,9 @@ from __future__ import unicode_literals # __IGNORE_WARNING__ from PyQt4.QtCore import pyqtSignal, Qt -from PyQt4.QtGui import QWidget, QColor, QPainter, QBoxLayout, QLabel, QFrame, \ - QPushButton, QSpinBox, QGroupBox, QVBoxLayout, QRadioButton, QSpacerItem, \ - QSizePolicy, QPixmap, QColorDialog +from PyQt4.QtGui import QWidget, QColor, QPainter, QBoxLayout, QLabel, \ + QFrame, QPushButton, QSpinBox, QGroupBox, QVBoxLayout, QRadioButton, \ + QSpacerItem, QSizePolicy, QPixmap, QColorDialog class IconEditorPalette(QWidget): @@ -20,8 +20,8 @@ Class implementing a palette widget for the icon editor. @signal colorSelected(QColor) emitted after a new color has been selected - @signal compositingChanged(QPainter.CompositionMode) emitted to signal a change - of the compositing mode + @signal compositingChanged(QPainter.CompositionMode) emitted to signal a + change of the compositing mode """ colorSelected = pyqtSignal(QColor) compositingChanged = pyqtSignal(QPainter.CompositionMode) @@ -65,14 +65,16 @@ self.__colorTxt.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) self.__colorTxt.setWhatsThis(self.trUtf8( """<b>Current Color Value</b>""" - """<p>This is the currently selected color value used for drawing.</p>""" + """<p>This is the currently selected color value used for""" + """ drawing.</p>""" )) self.__layout.addWidget(self.__colorTxt) self.__colorButton = QPushButton(self.trUtf8("Select Color"), self) self.__colorButton.setWhatsThis(self.trUtf8( """<b>Select Color</b>""" - """<p>Select the current drawing color via a color selection dialog.</p>""" + """<p>Select the current drawing color via a color selection""" + """ dialog.</p>""" )) self.__colorButton.clicked[()].connect(self.__selectColor) self.__layout.addWidget(self.__colorButton) @@ -81,7 +83,8 @@ self.__colorAlpha.setRange(0, 255) self.__colorAlpha.setWhatsThis(self.trUtf8( """<b>Select alpha channel value</b>""" - """<p>Select the value for the alpha channel of the current color.</p>""" + """<p>Select the value for the alpha channel of the current""" + """ color.</p>""" )) self.__layout.addWidget(self.__colorAlpha) self.__colorAlpha.valueChanged[int].connect(self.__alphaChanged) @@ -104,22 +107,28 @@ """<p>Blend the new color over the existing pixel.</p>""" )) self.__sourceOverButton.setChecked(True) - self.__sourceOverButton.clicked[bool].connect(self.__compositingChanged) + self.__sourceOverButton.clicked[bool].connect( + self.__compositingChanged) self.__compositingGroupLayout.addWidget(self.__sourceOverButton) self.__layout.addWidget(self.__compositingGroup) - spacer = QSpacerItem(10, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) + spacer = QSpacerItem( + 10, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) self.__layout.addItem(spacer) def previewChanged(self, pixmap): """ Public slot to update the preview. + + @param pixmap new preview pixmap (QPixmap) """ self.__preview.setPixmap(pixmap) def colorChanged(self, color): """ Public slot to update the color preview. + + @param color new color (QColor) """ self.__currentColor = color self.__currentAlpha = color.alpha() @@ -170,10 +179,13 @@ """ Private slot to handle a change of the compositing mode. - @param on flag indicating the checked state of the compositing button (boolean) + @param on flag indicating the checked state of the compositing button + (boolean) """ if on: if self.__sourceButton.isChecked(): - self.compositingChanged.emit(QPainter.CompositionMode_Source) + self.compositingChanged.emit( + QPainter.CompositionMode_Source) elif self.__sourceOverButton.isChecked(): - self.compositingChanged.emit(QPainter.CompositionMode_SourceOver) + self.compositingChanged.emit( + QPainter.CompositionMode_SourceOver)