aboutsummaryrefslogtreecommitdiff
path: root/components/original.py
diff options
context:
space:
mode:
authortassaron2017-05-30 22:05:56 -0400
committertassaron2017-05-30 22:05:56 -0400
commit5295a6d9ae3d73c7dceb286f13c6a1429e55393c (patch)
treeda62d3717a40689269f19375274d28d87619137e /components/original.py
parentca7e8bdb0dc998088aeb45a77987a78cc4656b34 (diff)
presets are working
except for font because it can't be represented as a string
Diffstat (limited to 'components/original.py')
-rw-r--r--components/original.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/components/original.py b/components/original.py
index 40f51eb..bebfdf2 100644
--- a/components/original.py
+++ b/components/original.py
@@ -32,12 +32,15 @@ class Component(__base__.Component):
self.visColor = self.RGBFromString(self.page.lineEdit_visColor.text())
self.parent.drawPreview()
- def loadPreset(self, presetDict):
- self.preFrameRender(**presetDict)
+ def loadPreset(self, pr):
+ self.page.lineEdit_visColor.setText('%s,%s,%s' % pr['visColor'])
+ btnStyle = "QPushButton { background-color : %s; outline: none; }" % QColor(*pr['visColor']).name()
+ self.page.pushButton_visColor.setStyleSheet(btnStyle)
+ self.page.comboBox_visLayout.setCurrentIndex(pr['layout'])
def savePreset(self):
- return { 'layout' : self.page.comboBox_visLayout.currentIndex(),
- 'visColor' : self.page.lineEdit_visColor.text(),
+ return { 'layout' : self.layout,
+ 'visColor' : self.visColor,
}
def previewRender(self, previewWorker):
@@ -61,6 +64,8 @@ class Component(__base__.Component):
def pickColor(self):
RGBstring, btnStyle = super().pickColor()
+ if not RGBstring:
+ return
self.page.lineEdit_visColor.setText(RGBstring)
self.page.pushButton_visColor.setStyleSheet(btnStyle)