aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-03 12:25:14 -0400
committerKen Moore <ken@ixsystems.com>2017-08-03 14:04:05 -0400
commit9787abdd5bc1378c7252ae710dc58ad582b447df (patch)
tree0552f7e557298527cc2f50a436620de2be7c9966 /src-qt5/core
parentCleanup the lumina-theme-engine subproject (diff)
downloadlumina-9787abdd5bc1378c7252ae710dc58ad582b447df.tar.gz
lumina-9787abdd5bc1378c7252ae710dc58ad582b447df.tar.bz2
lumina-9787abdd5bc1378c7252ae710dc58ad582b447df.zip
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
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/core.pro5
-rw-r--r--src-qt5/core/lumina-theme-engine/colors/darker.conf6
-rw-r--r--src-qt5/core/lumina-theme-engine/colors/dusk.conf6
-rw-r--r--src-qt5/core/lumina-theme-engine/lthemeengine.pro23
-rw-r--r--src-qt5/core/lumina-theme-engine/lumina-theme-engine.pro11
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp3
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.h2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.pro2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.cpp30
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.h5
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.ui40
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp3
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h2
13 files changed, 94 insertions, 44 deletions
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; i<paths.length(); i++){
if( !QFile::exists(paths[i])){ continue; }
QDir dir(paths[i]);
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.h
index 21eb5a6d..3f0fa427 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.h
@@ -35,7 +35,7 @@ private:
void readSettings();
void setStyle(QWidget *w, QStyle *s);
void setPalette(QWidget *w, QPalette p);
- void findColorSchemes(const QStringList &paths);
+ void findColorSchemes(QStringList paths);
QPalette loadColorScheme(const QString &filePath);
void createColorScheme(const QString &name, const QPalette &palette);
Ui::AppearancePage *m_ui;
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.pro b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.pro
index 28c97ef8..721b8888 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.pro
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.pro
@@ -2,7 +2,7 @@ include(../../lthemeengine.pri)
TEMPLATE = app
-QT += widgets
+QT *= widgets
SOURCES += \
main.cpp \
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.cpp
index 97d4ea1a..ac891a80 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsseditordialog.cpp
@@ -13,6 +13,30 @@ QSSEditorDialog::QSSEditorDialog(const QString &filePath, QWidget *parent) : QDi
setWindowTitle(tr("%1 - Style Sheet Editor").arg(file.fileName()));
QSettings settings(lthemeengine::configFile(), QSettings::IniFormat);
restoreGeometry(settings.value("QSSEditor/geometry").toByteArray());
+ //Generate the list of standard colors for the user to pick
+ QStringList colors;
+ colors << tr("base (alternate)")+"::::alternate-base"
+ << tr("base")+"::::base"
+ << tr("text (bright)")+"::::bright-text"
+ << tr("button")+"::::button"
+ << tr("text (button)")+"::::button-text"
+ << tr("dark")+"::::dark"
+ << tr("highlight")+"::::highlight"
+ << tr("text (highlight)")+"::::highlighted-text"
+ << tr("light")+"::::light"
+ << tr("link")+"::::link"
+ << tr("link (visited)")+"::::link-visited"
+ << tr("mid")+"::::mid"
+ << tr("midlight")+"::::midlight"
+ << tr("shadow")+"::::shadow"
+ << tr("text")+"::::text"
+ << tr("window")+"::::window"
+ << tr("text (window)")+"::::window-text";
+ colors.sort(); //sort by translated display name
+ colorMenu = new QMenu(m_ui->tool_color);
+ for(int i=0; i<colors.length(); i++){ colorMenu->addAction( 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 <QDialog>
#include <QString>
+#include <QMenu>
+#include <QAction>
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 @@
</widget>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save</set>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="tool_color">
+ <property name="text">
+ <string>Palette</string>
+ </property>
+ <property name="icon">
+ <iconset theme="preferences-desktop-color">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <property name="popupMode">
+ <enum>QToolButton::InstantPopup</enum>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Save</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
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<paths.length(); i++){
if(!QFile::exists(paths[i])){ continue; }
QDir dir(paths[i]);
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h
index 884f9a93..5e924ad9 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h
@@ -30,7 +30,7 @@ private slots:
private:
void readSettings();
- void findStyleSheets(const QStringList &paths);
+ void findStyleSheets(QStringList paths);
Ui::QSSPage *m_ui;
QMenu *m_menu;
};
bgstack15