From 9787abdd5bc1378c7252ae710dc58ad582b447df Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 3 Aug 2017 12:25:14 -0400 Subject: Fix up a bit more of the lumina-theme-engine 1. Adjust the build directories for all projects 2. Add lumina-theme-engine to the "core" meta-project 3. flip the names of the "dusk" and "darker" color schemes 4. Add a simple drop-down menu for standard colors when editing a stylesheet 5. Ensure the find colors/qss routines skip duplicate directory entries --- .../src/lthemeengine/appearancepage.cpp | 3 +- .../src/lthemeengine/appearancepage.h | 2 +- .../src/lthemeengine/lthemeengine.pro | 2 +- .../src/lthemeengine/qsseditordialog.cpp | 30 ++++++++++++++++ .../src/lthemeengine/qsseditordialog.h | 5 +++ .../src/lthemeengine/qsseditordialog.ui | 40 +++++++++++++++++----- .../src/lthemeengine/qsspage.cpp | 3 +- .../lumina-theme-engine/src/lthemeengine/qsspage.h | 2 +- 8 files changed, 74 insertions(+), 13 deletions(-) (limited to 'src-qt5/core/lumina-theme-engine/src/lthemeengine') diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp index af130ed5..04ca6a0b 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp @@ -222,7 +222,8 @@ void AppearancePage::setPalette(QWidget *w, QPalette p){ w->setPalette(p); } -void AppearancePage::findColorSchemes(const QStringList &paths){ +void AppearancePage::findColorSchemes(QStringList paths){ + paths.removeDuplicates(); for(int i=0; itool_color); + for(int i=0; iaddAction( colors[i].section("::::",0,0) )->setWhatsThis(colors[i].section("::::",1,1) ); } + m_ui->tool_color->setMenu(colorMenu); + connect(colorMenu, SIGNAL(triggered(QAction*)), this, SLOT(colorPicked(QAction*)) ); } QSSEditorDialog::~QSSEditorDialog(){ @@ -39,3 +63,9 @@ void QSSEditorDialog::on_buttonBox_clicked(QAbstractButton *button){ else if(id == QDialogButtonBox::Save){ save(); } else{ reject(); } } + +void QSSEditorDialog::colorPicked(QAction* act){ + QString id = act->whatsThis(); + if(id.isEmpty()){ return; } + m_ui->textEdit->insertPlainText( QString("palette(%1)").arg(id) ); +} diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.h index ea615e81..114611fe 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.h +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.h @@ -3,6 +3,8 @@ #include #include +#include +#include namespace Ui { class QSSEditorDialog; @@ -20,12 +22,15 @@ public: private slots: void on_buttonBox_clicked(QAbstractButton *button); + void colorPicked(QAction*); private: void save(); void hideEvent(QHideEvent *); Ui::QSSEditorDialog *m_ui; QString m_filePath; + QMenu *colorMenu; + }; #endif // QSSEDITORDIALOG_H diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.ui b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.ui index 7627b4d4..f75a21c6 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.ui +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.ui @@ -31,14 +31,38 @@ - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save - - + + + + + Palette + + + + .. + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextBesideIcon + + + true + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save + + + + diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp index 414273be..2cf0f221 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp @@ -105,7 +105,8 @@ void QSSPage::readSettings(){ } } -void QSSPage::findStyleSheets(const QStringList &paths){ +void QSSPage::findStyleSheets(QStringList paths){ + paths.removeDuplicates(); for(int i=0; i