[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] plugins/dockers/touchdocker: Let the touchdocker make use of the system colors.
From:       Wolthera_van_Hövell_tot_Westerflier <null () kde ! org>
Date:       2018-09-27 17:21:06
Message-ID: E1g5ZyM-000836-4w () code ! kde ! org
[Download RAW message or body]

Git commit 36e091b5b568c02c3f0b09b5f09e35d6bb13d369 by Wolthera van Hövell \
tot Westerflier. Committed on 27/09/2018 at 17:20.
Pushed by woltherav into branch 'master'.

Let the touchdocker make use of the system colors.

This only affects the regular touch docker, every single other thing needs \
to be updated still...

M  +10   -0    plugins/dockers/touchdocker/TouchDockerDock.cpp
M  +1    -0    plugins/dockers/touchdocker/TouchDockerDock.h
M  +39   -19   plugins/dockers/touchdocker/qml/touchstrip.qml

https://commits.kde.org/krita/36e091b5b568c02c3f0b09b5f09e35d6bb13d369

diff --git a/plugins/dockers/touchdocker/TouchDockerDock.cpp \
b/plugins/dockers/touchdocker/TouchDockerDock.cpp index \
                616fc178725..a0e2757956a 100644
--- a/plugins/dockers/touchdocker/TouchDockerDock.cpp
+++ b/plugins/dockers/touchdocker/TouchDockerDock.cpp
@@ -319,6 +319,16 @@ void TouchDockerDock::showFileSaveAsDialog()
     d->openDialog->exec();
 }
 
+void TouchDockerDock::changeEvent(QEvent *event)
+{
+    if (event->type() == QEvent::PaletteChange) {
+        m_quickWidget->setSource(QUrl("qrc:/touchstrip.qml"));
+        event->accept();
+    } else {
+        event->ignore();
+    }
+}
+
 KoDialog *TouchDockerDock::createDialog(const QString qml)
 {
     KoDialog *dlg = new KoDialog(this);
diff --git a/plugins/dockers/touchdocker/TouchDockerDock.h \
b/plugins/dockers/touchdocker/TouchDockerDock.h index \
                6678daaa3c0..16e2fb5a9fe 100644
--- a/plugins/dockers/touchdocker/TouchDockerDock.h
+++ b/plugins/dockers/touchdocker/TouchDockerDock.h
@@ -74,6 +74,7 @@ private:
 
     void showFileOpenDialog();
     void showFileSaveAsDialog();
+    void changeEvent(QEvent* event) override;
 
     KoDialog *createDialog(const QString qml);
 
diff --git a/plugins/dockers/touchdocker/qml/touchstrip.qml \
b/plugins/dockers/touchdocker/qml/touchstrip.qml index \
                e2bb2cc8a21..5db5b230c43 100644
--- a/plugins/dockers/touchdocker/qml/touchstrip.qml
+++ b/plugins/dockers/touchdocker/qml/touchstrip.qml
@@ -4,11 +4,14 @@ import org.krita.sketch.components 1.0
 
 Rectangle {
     id: base
-    color: "#545454"
+    property var palette: SystemPalette {colorGroup: SystemPalette.active \
} +
+    color: palette.dark
     
     Button {
         id: fileOpenButton
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -22,7 +25,8 @@ Rectangle {
 
     Button {
         id: fileSaveButton
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -36,7 +40,8 @@ Rectangle {
 
     Button {
         id: fileSaveAsButton
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -50,7 +55,8 @@ Rectangle {
     
     Button {
         id: undoButton
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 2
         height: base.height / 13
@@ -64,7 +70,8 @@ Rectangle {
 
     Button {
         id: redoButton
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 2
         height: base.height / 13
@@ -78,7 +85,8 @@ Rectangle {
     
     Button {
         id: button1
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -94,7 +102,8 @@ Rectangle {
 
     Button {
         id: button2
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -110,7 +119,8 @@ Rectangle {
 
     Button {
         id: button3
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -126,7 +136,8 @@ Rectangle {
 
     Button {
         id: button4
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -142,7 +153,8 @@ Rectangle {
 
     Button {
         id: rockerSwitchTop
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -159,7 +171,8 @@ Rectangle {
 
     Button {
         id: rockerSwitchLeft
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -174,7 +187,8 @@ Rectangle {
 
     Button {
         id: rockerSwitchCenter
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -190,7 +204,8 @@ Rectangle {
 
     Button {
         id: rockerSwitchRight
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -205,7 +220,8 @@ Rectangle {
 
     Button {
         id: rockerSwitchBottom
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         radius: 8
         width: base.width / 3
         height: base.height / 13
@@ -221,7 +237,8 @@ Rectangle {
 
     Button {
         id: button5
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -237,7 +254,8 @@ Rectangle {
 
     Button {
         id: button6
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -253,7 +271,8 @@ Rectangle {
 
     Button {
         id: button7
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left
@@ -269,7 +288,8 @@ Rectangle {
 
     Button {
         id: button8
-        color: "grey"
+        color: palette.button
+        textColor: palette.buttonText
         width: base.width
         height: base.height / 13
         anchors.left: base.left


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic