aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
committerWeblate <noreply@weblate.org>2017-11-04 19:28:17 +0000
commit7787f617656751ee7e0a58c813d0bfd5757c5c97 (patch)
tree48aa053bbd4fda9c64f89a061a2f442c860ab13d /src-qt5/core/lumina-theme-engine
parentTranslated using Weblate (Lithuanian) (diff)
parentMerge pull request #497 from a-stjohn/patch-1 (diff)
downloadlumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.gz
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.tar.bz2
lumina-7787f617656751ee7e0a58c813d0bfd5757c5c97.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/qss/scrollbar-simple.qss2
-rw-r--r--src-qt5/core/lumina-theme-engine/qss/sliders-simple.qss70
-rw-r--r--src-qt5/core/lumina-theme-engine/qss/tooltip-simple.qss7
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui2
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp33
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h1
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.ui41
8 files changed, 153 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-theme-engine/qss/scrollbar-simple.qss b/src-qt5/core/lumina-theme-engine/qss/scrollbar-simple.qss
index 265ff20c..d0c9b448 100644
--- a/src-qt5/core/lumina-theme-engine/qss/scrollbar-simple.qss
+++ b/src-qt5/core/lumina-theme-engine/qss/scrollbar-simple.qss
@@ -11,7 +11,7 @@ QScrollBar:vertical{
QScrollBar::handle{
background: palette(base);
border: 1px solid transparent;
- border-radius: 7px;
+ border-radius: 1px;
}
QScrollBar::handle:hover, QScrollBar::add-line:hover, QScrollBar::sub-line:hover{
background: palette(highlight);
diff --git a/src-qt5/core/lumina-theme-engine/qss/sliders-simple.qss b/src-qt5/core/lumina-theme-engine/qss/sliders-simple.qss
new file mode 100644
index 00000000..e8311e92
--- /dev/null
+++ b/src-qt5/core/lumina-theme-engine/qss/sliders-simple.qss
@@ -0,0 +1,70 @@
+/* SLIDERS */
+QSlider::groove:horizontal {
+border: 1px solid transparent;
+background: palette(alternate-window);
+height: 10px;
+border-radius: 3px;
+}
+QSlider::groove:vertical {
+border: 1px solid transparent;
+background: palette(alternate-window);
+width: 10px;
+border-radius: 3px;
+}
+QSlider::sub-page:horizontal {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1,
+ stop: 0 palette(highlight), stop: 1 palette(window));
+border: 1px solid transparent;
+height: 10px;
+border-radius: 3px;
+}
+QSlider::sub-page:vertical {
+background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1,
+ stop: 0 palette(highlight), stop: 1 palette(window));
+border: 1px solid transparent;
+width: 10px;
+border-radius: 3px;
+}
+QSlider::add-page:horizontal{
+background: palette(alternate-window);
+border: 1px solid transparent;
+height: 10px;
+border-radius: 3px;
+}
+QSlider::add-page:vertical{
+background: palette(alternate-window);
+border: 1px solid transparent;
+width: 10px;
+border-radius: 3px;
+}
+QSlider::handle:horizontal{
+background: palette(mid);
+border: 1px solid palette(mid);
+width: 1em;
+border-radius: 1px;
+}
+QSlider::handle:vertical{
+background: palette(mid);
+border: 1px solid palette(mid);
+height: 1em;
+border-radius: 1px;
+}
+QSlider::handle:horizontal:hover, QSlider::handle:vertical:hover{
+border: 1px solid palette(highlight);
+background: palette(highlight);
+}
+
+QSlider::sub-page:horizontal:disabled {
+background: palette(highlight);
+border-color: palette(highlight);
+}
+
+QSlider::add-page:horizontal:disabled {
+background: palette(highlight);
+border-color: palette(highlight);
+}
+
+QSlider::handle:horizontal:disabled {
+background: palette(alternate-window);
+border: 1px solid palette(highlight);
+}
diff --git a/src-qt5/core/lumina-theme-engine/qss/tooltip-simple.qss b/src-qt5/core/lumina-theme-engine/qss/tooltip-simple.qss
new file mode 100644
index 00000000..9bee3e08
--- /dev/null
+++ b/src-qt5/core/lumina-theme-engine/qss/tooltip-simple.qss
@@ -0,0 +1,7 @@
+QToolTip{
+ background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 palette(window), stop: 1 palette(alternate-window));
+ border-radius: 3px;
+ border: 1px solid palette(highlight);
+ padding: 1px;
+ color: palette(text);
+}
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 d4544c7b..28a5e558 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.cpp
@@ -55,7 +55,7 @@ void MainWindow::on_buttonBox_clicked(QAbstractButton *button){
if(p) { p->writeSettings(); }
}
}
- if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Cancel){
+ if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Cancel || id== QDialogButtonBox::Close){
close();
qApp->quit();
}
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 dd676c37..0dc3245d 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/mainwindow.ui
@@ -293,7 +293,7 @@ Styles</string>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
- <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Apply|QDialogButtonBox::Close</set>
</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 cd88fb56..6377016c 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.cpp
@@ -31,6 +31,7 @@ QSSPage::QSSPage(QWidget *parent, bool desktop) : TabPage(parent), m_ui(new Ui::
m_ui->removeButton->setIcon(QIcon::fromTheme("edit-delete"));
m_ui->tool_enable->setEnabled(false);
m_ui->tool_disable->setEnabled(false);
+ m_ui->copyButton->setEnabled(false);
}
QSSPage::~QSSPage(){
@@ -56,6 +57,7 @@ void QSSPage::on_qssListWidget_currentItemChanged(QListWidgetItem *current, QLis
}
//qDebug() << "Got Current Item Changed";
m_ui->tool_disable->setEnabled(current!=0);
+ m_ui->copyButton->setEnabled(current!=0);
if(current){
m_ui->editButton->setEnabled(current->data(QSS_WRITABLE_ROLE).toBool());
m_ui->removeButton->setEnabled(current->data(QSS_WRITABLE_ROLE).toBool());
@@ -76,6 +78,7 @@ void QSSPage::on_list_disabled_currentItemChanged(QListWidgetItem *current, QLis
}
//qDebug() << "Got Current Item Changed";
m_ui->tool_enable->setEnabled(current!=0);
+ m_ui->copyButton->setEnabled(current!=0);
if(current){
m_ui->editButton->setEnabled(current->data(QSS_WRITABLE_ROLE).toBool());
m_ui->removeButton->setEnabled(current->data(QSS_WRITABLE_ROLE).toBool());
@@ -127,6 +130,36 @@ void QSSPage::on_editButton_clicked(){
}
}
+void QSSPage::on_copyButton_clicked(){
+ QListWidgetItem *sel = currentSelection();
+ if(sel==0){ return; }
+ QString name = QInputDialog::getText(this, tr("Enter Style Sheet Name"), tr("File name:"), QLineEdit::Normal, sel->text().section(".qss",0,0)+"_copy");
+ if(name.isEmpty()){ return; }
+ if(!name.endsWith(".qss", Qt::CaseInsensitive)){ name.append(".qss"); }
+ QString filePath;
+ if(desktop_qss){ filePath = lthemeengine::userDesktopStyleSheetPath() + name; }
+ else{ filePath = lthemeengine::userStyleSheetPath() + name; }
+ if(QFile::exists(filePath)){
+ QMessageBox::warning(this, tr("Error"), tr("The file \"%1\" already exists").arg(filePath));
+ return;
+ }
+ // Make sure the directory exists
+ QString dir = filePath.section("/",0,-2);
+ if(!QFile::exists(dir)){
+ QDir D(dir);
+ D.mkpath(dir);
+ }
+ //Copy the file over
+ QFile::copy(sel->data(QSS_FULL_PATH_ROLE).toString(), filePath);
+ //creating item
+ QFileInfo info(filePath);
+ QListWidgetItem *item = new QListWidgetItem(info.fileName(), m_ui->list_disabled);
+ item->setToolTip(info.filePath());
+ item->setData(QSS_FULL_PATH_ROLE, info.filePath());
+ item->setData(QSS_WRITABLE_ROLE, info.isWritable());
+ m_ui->list_disabled->setCurrentRow(m_ui->list_disabled->count()-1);
+}
+
void QSSPage::on_removeButton_clicked(){
QListWidgetItem *item = currentSelection();
if(!item){ return; }
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 5b0025c5..07df4ac2 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.h
@@ -24,6 +24,7 @@ private slots:
void on_qssListWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *);
void on_list_disabled_currentItemChanged(QListWidgetItem *current, QListWidgetItem *);
void on_createButton_clicked();
+ void on_copyButton_clicked();
void on_editButton_clicked();
void on_removeButton_clicked();
void on_renameButton_clicked();
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.ui b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.ui
index f9a980f3..def99dd0 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.ui
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/qsspage.ui
@@ -63,7 +63,7 @@
<item>
<spacer name="horizontalSpacer_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -168,7 +168,7 @@
<item>
<spacer name="horizontalSpacer_3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -222,16 +222,41 @@
<property name="enabled">
<bool>true</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Create</string>
</property>
</widget>
</item>
<item>
+ <widget class="QToolButton" name="copyButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QPushButton" name="editButton">
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Edit</string>
</property>
@@ -242,6 +267,12 @@
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Rename</string>
</property>
@@ -252,6 +283,12 @@
<property name="enabled">
<bool>false</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Remove</string>
</property>
bgstack15