diff options
| author | tassaron | 2017-06-16 00:01:34 -0400 |
|---|---|---|
| committer | tassaron | 2017-06-16 00:01:34 -0400 |
| commit | 4b1058781d39ea3e43197c559dd3631bae42b66b (patch) | |
| tree | 8c4d30cb37a6b818a62dce5ea557add22ab11126 /components/color.py | |
| parent | fc7ee6d8e5b5a96ec06918f9b5dd9310cdf814de (diff) | |
added width and height to color.ui
Diffstat (limited to 'components/color.py')
| -rw-r--r-- | components/color.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/components/color.py b/components/color.py index 36f3906..fda7376 100644 --- a/components/color.py +++ b/components/color.py @@ -37,8 +37,12 @@ class Component(__base__.Component): # disable color #2 until non-default 'fill' option gets changed page.lineEdit_color2.setDisabled(True) page.pushButton_color2.setDisabled(True) - page.spinBox_x.setValue(self.x) - page.spinBox_x.setValue(self.y) + page.spinBox_x.valueChanged.connect(self.update) + page.spinBox_y.valueChanged.connect(self.update) + page.spinBox_width.setValue( + int(parent.settings.value("outputWidth"))) + page.spinBox_height.setValue( + int(parent.settings.value("outputHeight"))) page.lineEdit_color1.textChanged.connect(self.update) page.lineEdit_color2.textChanged.connect(self.update) @@ -71,13 +75,16 @@ class Component(__base__.Component): def drawFrame(self, width, height): r, g, b = self.color1 - return self.blankFrame(width, height) + return Image.new("RGBA", (width, height), (r, g, b, 255)) def loadPreset(self, pr, presetName=None): super().loadPreset(pr, presetName) self.page.lineEdit_color1.setText('%s,%s,%s' % pr['color1']) self.page.lineEdit_color2.setText('%s,%s,%s' % pr['color2']) + self.page.spinBox_x.setValue(pr['x']) + self.page.spinBox_y.setValue(pr['y']) + self.page.lineEdit_color2.setText('%s,%s,%s' % pr['color2']) btnStyle1 = "QPushButton { background-color : %s; outline: none; }" \ % QColor(*pr['color1']).name() @@ -93,6 +100,8 @@ class Component(__base__.Component): 'preset': self.currentPreset, 'color1': self.color1, 'color2': self.color2, + 'x': self.x, + 'y': self.y, } def pickColor(self, num): |
