aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-27 09:55:06 +0000
committerWeblate <noreply@weblate.org>2017-11-27 09:55:06 +0000
commit152a57c8c2844d63f95803128b216c8ab722e6e2 (patch)
tree0ce13eccbf6ef36df43d4c558657c9699f757d20 /src-qt5/core/lumina-theme-engine
parentTranslated using Weblate (Spanish) (diff)
parentremove file manager dev folder (diff)
downloadlumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.gz
lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.bz2
lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-theme-engine')
-rw-r--r--src-qt5/core/lumina-theme-engine/lthemeengine.pri2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp4
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp30
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.h3
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui45
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp7
6 files changed, 72 insertions, 19 deletions
diff --git a/src-qt5/core/lumina-theme-engine/lthemeengine.pri b/src-qt5/core/lumina-theme-engine/lthemeengine.pri
index 40202045..781527c1 100644
--- a/src-qt5/core/lumina-theme-engine/lthemeengine.pri
+++ b/src-qt5/core/lumina-theme-engine/lthemeengine.pri
@@ -3,7 +3,7 @@ QT *= core gui widgets x11extras network
error("Use Qt 5.4.0 or higher.")
}
include(../../OS-detect.pri)
-
+include(../libLumina/LDesktopUtils.pri)
CONFIG *= c++11
#Install paths
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 88bde228..98f9c865 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/appearancepage.cpp
@@ -195,6 +195,10 @@ void AppearancePage::readSettings(){
m_ui->styleComboBox->setCurrentText(style);
m_ui->customPaletteButton->setChecked(settings.value("custom_palette", false).toBool());
QString colorSchemePath = settings.value("color_scheme_path").toString();
+ if(colorSchemePath.contains("..") || colorSchemePath.contains("//") ){
+ //Make this an absolute path for comparison later
+ colorSchemePath = QFileInfo(colorSchemePath).absoluteFilePath();
+ }
QDir("/").mkpath(lthemeengine::userColorSchemePath());
findColorSchemes( QStringList() << lthemeengine::userColorSchemePath() << lthemeengine::sharedColorSchemePath());
if(m_ui->colorSchemeComboBox->count() == 0){
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp
index 28a5e558..a82f8cc6 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp
@@ -13,6 +13,8 @@
#include "qsspage.h"
#include "ui_mainwindow.h"
+#include <LDesktopUtils.h>
+
MainWindow::MainWindow(QWidget *parent) : QWidget(parent), m_ui(new Ui::MainWindow){
m_ui->setupUi(this);
bgroup = new QButtonGroup(this);
@@ -30,12 +32,16 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent), m_ui(new Ui::MainWind
bgroup->addButton(m_ui->tool_page_deskstyles, m_ui->stackedWidget->addWidget(new QSSPage(this, true)));
bgroup->addButton(m_ui->tool_page_cursors, m_ui->stackedWidget->addWidget(new CursorThemePage(this)) );
connect(bgroup, SIGNAL(buttonClicked(int)), m_ui->stackedWidget, SLOT(setCurrentIndex(int)) );
+ connect(m_ui->push_close, SIGNAL(clicked()), this, SLOT(closeWindow()) );
+ connect(m_ui->push_apply, SIGNAL(clicked()), this, SLOT(applyWindow()) );
QTimer::singleShot(10, m_ui->tool_page_general, SLOT(toggle()));
QSettings settings(lthemeengine::configFile(), QSettings::IniFormat);
restoreGeometry(settings.value("SettingsWindow/geometry").toByteArray());
setWindowIcon(QIcon::fromTheme("preferences-desktop-theme"));
- m_ui->versionLabel->setText(tr("Version: %1").arg(LTHEMEENGINE_VERSION_STR));
+ this->setWindowTitle(tr("Theme Settings"));
+ m_ui->versionLabel->setText(tr("Version: %1").arg(LDesktopUtils::LuminaDesktopVersion()));
+ //m_ui->buttonBox->set
}
MainWindow::~MainWindow(){
@@ -47,16 +53,14 @@ void MainWindow::closeEvent(QCloseEvent *){
settings.setValue("SettingsWindow/geometry", saveGeometry());
}
-void MainWindow::on_buttonBox_clicked(QAbstractButton *button){
- int id = m_ui->buttonBox->standardButton(button);
- if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Apply){
- for(int i = 0; i < m_ui->stackedWidget->count(); ++i){
- TabPage *p = qobject_cast<TabPage*>(m_ui->stackedWidget->widget(i));
- if(p) { p->writeSettings(); }
- }
- }
- if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Cancel || id== QDialogButtonBox::Close){
- close();
- qApp->quit();
- }
+void MainWindow::closeWindow(){
+ close();
+ QApplication::quit();
+}
+
+void MainWindow::applyWindow(){
+ for(int i = 0; i < m_ui->stackedWidget->count(); ++i){
+ TabPage *p = qobject_cast<TabPage*>(m_ui->stackedWidget->widget(i));
+ if(p) { p->writeSettings(); }
+ }
}
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.h
index 56ff1c98..333bc1fd 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.h
@@ -19,7 +19,8 @@ public:
~MainWindow();
private slots:
- void on_buttonBox_clicked(QAbstractButton *button);
+ void closeWindow();
+ void applyWindow();
private:
void closeEvent(QCloseEvent *);
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui
index 0dc3245d..c60eb870 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>672</width>
- <height>723</height>
+ <height>747</height>
</rect>
</property>
<property name="windowTitle">
@@ -285,15 +285,52 @@ Styles</string>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="versionLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string notr="true">...</string>
</property>
</widget>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Apply|QDialogButtonBox::Close</set>
+ <widget class="QToolButton" name="push_close">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ <property name="icon">
+ <iconset theme="dialog-cancel"/>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="push_apply">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Apply</string>
+ </property>
+ <property name="icon">
+ <iconset theme="dialog-ok-apply"/>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
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 6377016c..3140c553 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
@@ -224,7 +224,14 @@ void QSSPage::readSettings(){
QStringList styleSheets;
if(desktop_qss){ styleSheets = settings.value("Interface/desktop_stylesheets").toStringList(); }
else{ styleSheets = settings.value("Interface/stylesheets").toStringList(); }
+ for(int i=0; i<styleSheets.length(); i++){
+ if(styleSheets[i].contains("..") || styleSheets[i].contains("//") ){
+ //Get the absolute path for matching later
+ styleSheets[i] = QFileInfo(styleSheets[i]).absoluteFilePath();
+ }
+ }
//Now load the items into list widgets
+ //qDebug() << "Found Stylesheets" << styleSheets;
if(desktop_qss){ findStyleSheets(QStringList() << lthemeengine::userDesktopStyleSheetPath() << lthemeengine::sharedDesktopStyleSheetPath(), styleSheets); }
else{findStyleSheets(QStringList() << lthemeengine::userStyleSheetPath() << lthemeengine::sharedStyleSheetPath(), styleSheets); }
bgstack15