From 5295a6d9ae3d73c7dceb286f13c6a1429e55393c Mon Sep 17 00:00:00 2001 From: tassaron Date: Tue, 30 May 2017 22:05:56 -0400 Subject: presets are working except for font because it can't be represented as a string --- components/original.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'components/original.py') 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) -- cgit v1.2.3