From 431b9f63048850f6e3151b1bfd8650143f50dfe7 Mon Sep 17 00:00:00 2001 From: tassaron Date: Mon, 22 May 2017 22:25:38 -0400 Subject: colors are configurable in the GUI any invalid RGB tuple entered will result in white --- main.ui | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'main.ui') diff --git a/main.ui b/main.ui index c500905..88d5173 100644 --- a/main.ui +++ b/main.ui @@ -276,7 +276,7 @@ - + 200 @@ -303,13 +303,71 @@ + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + - + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + 200 + 0 + + + + QFrame::NoFrame + + + + + + + + + + + -- cgit v1.2.3 From a251be0cd46d3702fcbb5cabf0ff4a348b42b66e Mon Sep 17 00:00:00 2001 From: tassaron Date: Tue, 23 May 2017 18:19:55 -0400 Subject: select colors more easily using QColorDialog --- main.py | 23 +++++++++++++++++++++-- main.ui | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) (limited to 'main.ui') diff --git a/main.py b/main.py index 0a37351..16697d6 100644 --- a/main.py +++ b/main.py @@ -162,10 +162,11 @@ class Main(QtCore.QObject): window.pushButton_selectBackground.setText("Select Background Image") window.label_font.setText("Title Font") window.label_alignment.setText("Title Options") + window.label_colorOptions.setText("Colors") window.label_fontsize.setText("Fontsize") window.label_title.setText("Title Text") - window.label_textColor.setText("Text color:") - window.label_visColor.setText("Visualizer color:") + window.label_textColor.setText("Text:") + window.label_visColor.setText("Visualizer:") window.pushButton_createVideo.setText("Create Video") window.groupBox_create.setTitle("Create") window.groupBox_settings.setTitle("Settings") @@ -179,6 +180,12 @@ class Main(QtCore.QObject): window.textYSpinBox.setValue(375) window.lineEdit_textColor.setText('%s,%s,%s' % self.textColor) window.lineEdit_visColor.setText('%s,%s,%s' % self.visColor) + window.pushButton_textColor.clicked.connect(lambda: self.pickColor('text')) + window.pushButton_visColor.clicked.connect(lambda: self.pickColor('vis')) + btnStyle = "QPushButton { background-color : %s; outline: none; }" % QColor(*self.textColor).name() + window.pushButton_textColor.setStyleSheet(btnStyle) + btnStyle = "QPushButton { background-color : %s; outline: none; }" % QColor(*self.visColor).name() + window.pushButton_visColor.setStyleSheet(btnStyle) titleFont = self.settings.value("titleFont") if not titleFont == None: @@ -307,6 +314,18 @@ class Main(QtCore.QObject): self.window.label_preview.setPixmap(self._previewPixmap) + def pickColor(self, colorTarget): + color = QtGui.QColorDialog.getColor() + if color.isValid(): + RGBstring = '%s,%s,%s' % (str(color.red()), str(color.green()), str(color.blue())) + btnStyle = "QPushButton { background-color : %s; outline: none; }" % color.name() + if colorTarget == 'text': + self.window.lineEdit_textColor.setText(RGBstring) + window.pushButton_textColor.setStyleSheet(btnStyle) + elif colorTarget == 'vis': + self.window.lineEdit_visColor.setText(RGBstring) + window.pushButton_visColor.setStyleSheet(btnStyle) + if len(sys.argv) > 1: # command line mode app = QtGui.QApplication(sys.argv, False) diff --git a/main.ui b/main.ui index 88d5173..12e9d04 100644 --- a/main.ui +++ b/main.ui @@ -313,6 +313,19 @@ + + + + + 32 + 32 + + + + + + + @@ -326,6 +339,19 @@ + + + + + 32 + 32 + + + + + + + -- cgit v1.2.3 From 624ec8dca2872813789cf2d5fa32c523f4359d86 Mon Sep 17 00:00:00 2001 From: tassaron Date: Thu, 25 May 2017 12:01:03 -0400 Subject: improved color button ui xml --- main.ui | 158 ++++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 85 insertions(+), 73 deletions(-) (limited to 'main.ui') diff --git a/main.ui b/main.ui index 12e9d04..9964b72 100644 --- a/main.ui +++ b/main.ui @@ -303,97 +303,109 @@ - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 32 - 32 - - - - - - - - - - - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 32 - 32 - - - - - - - - + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + - - - - - - - - + + - 200 - 0 + 32 + 32 - + + + + - 200 - 16777215 + 32 + 32 - + + + + + + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + - 200 - 0 + 32 + 32 - - QFrame::NoFrame - + + + 32 + 32 + + - + + + + + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + 200 + 0 + + + + QFrame::NoFrame + + + + + + + + + + + @@ -469,12 +481,12 @@ 24 + + Qt::AlignCenter + true - - Qt::AlignCenter - -- cgit v1.2.3