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-qt5/core/core.pro | 5 +-- .../core/lumina-theme-engine/colors/darker.conf | 6 ++-- src-qt5/core/lumina-theme-engine/colors/dusk.conf | 6 ++-- src-qt5/core/lumina-theme-engine/lthemeengine.pro | 23 ------------- .../lumina-theme-engine/lumina-theme-engine.pro | 11 ++++++ .../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 +- 13 files changed, 94 insertions(+), 44 deletions(-) delete mode 100644 src-qt5/core/lumina-theme-engine/lthemeengine.pro create mode 100644 src-qt5/core/lumina-theme-engine/lumina-theme-engine.pro (limited to 'src-qt5/core') diff --git a/src-qt5/core/core.pro b/src-qt5/core/core.pro index 4878b1f3..0f635960 100644 --- a/src-qt5/core/core.pro +++ b/src-qt5/core/core.pro @@ -8,9 +8,10 @@ SUBDIRS+= lumina-desktop \ lumina-session \ lumina-open \ lumina-info \ - $${PWD}/../../icon-theme -# lumina-wm-INCOMPLETE \ + $${PWD}/../../icon-theme \ + lumina-theme-engine # lumina-checkpass +# lumina-desktop-unified #Also install any special menu scripts scripts.path = $${L_SHAREDIR}/lumina-desktop/menu-scripts diff --git a/src-qt5/core/lumina-theme-engine/colors/darker.conf b/src-qt5/core/lumina-theme-engine/colors/darker.conf index 5186ecef..9c822b60 100644 --- a/src-qt5/core/lumina-theme-engine/colors/darker.conf +++ b/src-qt5/core/lumina-theme-engine/colors/darker.conf @@ -1,4 +1,4 @@ [ColorScheme] -active_colors=#000000, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #000000, #ffffff, #000000, #7f7f7f, #7f7f7f, #707070, #308cc6, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 -disabled_colors=#bebebe, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #bebebe, #ffffff, #bebebe, #7f7f7f, #7f7f7f, #b1aeab, #7f7f7f, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 -inactive_colors=#000000, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #000000, #ffffff, #000000, #7f7f7f, #7f7f7f, #707070, #308cc6, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 +active_colors=#ffffff, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #222020, #e7e4e0, #12608a, #f9f9f9, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff +disabled_colors=#808080, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #808080, #ffffff, #808080, #3d3d3d, #222020, #e7e4e0, #12608a, #808080, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff +inactive_colors=#ffffff, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #222020, #e7e4e0, #12608a, #f9f9f9, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff diff --git a/src-qt5/core/lumina-theme-engine/colors/dusk.conf b/src-qt5/core/lumina-theme-engine/colors/dusk.conf index 9c822b60..5186ecef 100644 --- a/src-qt5/core/lumina-theme-engine/colors/dusk.conf +++ b/src-qt5/core/lumina-theme-engine/colors/dusk.conf @@ -1,4 +1,4 @@ [ColorScheme] -active_colors=#ffffff, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #222020, #e7e4e0, #12608a, #f9f9f9, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff -disabled_colors=#808080, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #808080, #ffffff, #808080, #3d3d3d, #222020, #e7e4e0, #12608a, #808080, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff -inactive_colors=#ffffff, #424245, #979797, #5e5c5b, #302f2e, #4a4947, #ffffff, #ffffff, #ffffff, #3d3d3d, #222020, #e7e4e0, #12608a, #f9f9f9, #0986d3, #a70b06, #5c5b5a, #ffffff, #3f3f36, #ffffff +active_colors=#000000, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #000000, #ffffff, #000000, #7f7f7f, #7f7f7f, #707070, #308cc6, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 +disabled_colors=#bebebe, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #bebebe, #ffffff, #bebebe, #7f7f7f, #7f7f7f, #b1aeab, #7f7f7f, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 +inactive_colors=#000000, #7f7f7f, #ffffff, #cbc7c4, #7f7f7f, #b8b5b2, #000000, #ffffff, #000000, #7f7f7f, #7f7f7f, #707070, #308cc6, #ffffff, #0000ff, #ff00ff, #7f7f7f, #000000, #7f7f7f, #000000 diff --git a/src-qt5/core/lumina-theme-engine/lthemeengine.pro b/src-qt5/core/lumina-theme-engine/lthemeengine.pro deleted file mode 100644 index 8bad53f6..00000000 --- a/src-qt5/core/lumina-theme-engine/lthemeengine.pro +++ /dev/null @@ -1,23 +0,0 @@ -QT *= core gui widgets x11extras network -!isEqual (QT_MAJOR_VERSION, 5) { - error("Use Qt 5.4.0 or higher.") -} -include(../../OS-detect.pri) - -CONFIG *= c++11 - -desktop.files=src/lthemeengine/ltheme.desktop -desktop.path=$${L_SHAREDIR}/applications/ - -#Install paths - PLUGINDIR = $${DISTDIR}$$[QT_INSTALL_PLUGINS] - DEFINES += LTHEMEENGINE_DATADIR=\\\"$$L_SHAREDIR\\\" - -TEMPLATE = subdirs - -SUBDIRS += src/lthemeengine-qtplugin src/lthemeengine-style src/lthemeengine - -colors.files = colors/*.conf -colors.path = $${L_SHAREDIR}/lthemeengine/colors - -INSTALLS += colors diff --git a/src-qt5/core/lumina-theme-engine/lumina-theme-engine.pro b/src-qt5/core/lumina-theme-engine/lumina-theme-engine.pro new file mode 100644 index 00000000..d91091d3 --- /dev/null +++ b/src-qt5/core/lumina-theme-engine/lumina-theme-engine.pro @@ -0,0 +1,11 @@ +include(../../OS-detect.pri) + +TEMPLATE = subdirs +SUBDIRS += src/lthemeengine-qtplugin \ + src/lthemeengine-style \ + src/lthemeengine + +colors.files = colors/*.conf +colors.path = $${L_SHAREDIR}/lthemeengine/colors + +INSTALLS += colors 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