summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-08 12:06:02 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-13 11:32:27 -0700
commit26a7cf1698c61e53be59ee91f5b3e3c814556571 (patch)
treef650d46b485f5dff35421ded1cdf66ce4edb1cdd /scripts
parentfda10b8baada4182287e46278aa4bc000313be50 (diff)
downloadsubsurface-26a7cf1698c61e53be59ee91f5b3e3c814556571.tar.gz
Mobile: hack around toolbar theme issue
Whatever I try, the toolbar background is always based on the 'active' color set in qtquickcontrols2.conf, not on anything that I can set in QML code. So in an effort to brute-force the issue, this hardcodes the subsurfaceTheme value in the toolbar UI code of Kirigami. To make this easier, this (and one of the other hacks) is added to the existing kirigami.diff. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kirigami.diff39
-rwxr-xr-xscripts/mobilecomponents.sh11
2 files changed, 43 insertions, 7 deletions
diff --git a/scripts/kirigami.diff b/scripts/kirigami.diff
index 49027d23f..b0fb01ad6 100644
--- a/scripts/kirigami.diff
+++ b/scripts/kirigami.diff
@@ -1,7 +1,7 @@
-diff -ur ../kirigami/src/controls/GlobalDrawer.qml mobile-widgets/qml/kirigami/src/controls/GlobalDrawer.qml
---- ../kirigami/src/controls/GlobalDrawer.qml 2018-09-27 15:27:32.340600738 +0200
-+++ src/controls/GlobalDrawer.qml 2018-09-27 16:45:29.689438950 +0200
-@@ -328,17 +328,13 @@
+diff -rwu ../kirigami/src/controls/GlobalDrawer.qml mobile-widgets/qml/kirigami/src/controls/GlobalDrawer.qml
+--- ../kirigami/src/controls/GlobalDrawer.qml 2019-10-05 11:32:27.131891061 -0500
++++ src/controls/GlobalDrawer.qml 2019-10-06 13:14:34.830804840 -0500
+@@ -331,17 +331,13 @@
ColumnLayout {
id: topContent
spacing: 0
@@ -20,3 +20,34 @@ diff -ur ../kirigami/src/controls/GlobalDrawer.qml mobile-widgets/qml/kirigami/s
visible: children.length > 0 && childrenRect.height > 0 && opacity > 0
opacity: !root.collapsed || showTopContentWhenCollapsed
Behavior on opacity {
+diff -rwu ../kirigami/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml mobile-widgets/qml/kirigami/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
+--- ../kirigami/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml 2019-10-05 11:32:27.135224411 -0500
++++ src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml 2019-10-08 10:57:14.603086232 -0500
+@@ -40,6 +40,7 @@
+ preferredHeight: globalToolBar.preferredHeight
+ maximumHeight: globalToolBar.maximumHeight
+ separatorVisible: globalToolBar.separatorVisible
++ background: Rectangle { color: subsurfaceTheme.primaryColor }
+
+ RowLayout {
+ anchors.fill: parent
+@@ -110,6 +111,6 @@
+ Layout.preferredWidth: height
+ }
+ }
+- background.opacity: breadcrumbLoader.opacity
++ //background.opacity: breadcrumbLoader.opacity
+ }
+
+diff -rwu ../kirigami/src/kirigamiplugin.cpp mobile-widgets/qml/kirigami/src/kirigamiplugin.cpp
+--- ../kirigami/src/kirigamiplugin.cpp 2019-10-05 11:32:27.141891113 -0500
++++ src/kirigamiplugin.cpp 2019-10-05 11:52:30.444777441 -0500
+@@ -41,7 +41,7 @@
+
+ //Q_INIT_RESOURCE(kirigami);
+ #ifdef KIRIGAMI_BUILD_TYPE_STATIC
+-#include <qrc_kirigami.cpp>
++//#include <qrc_kirigami.cpp>
+ #endif
+
+ QUrl KirigamiPlugin::componentUrl(const QString &fileName) const
diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh
index 6945a3713..9b527fc6b 100755
--- a/scripts/mobilecomponents.sh
+++ b/scripts/mobilecomponents.sh
@@ -59,20 +59,25 @@ ln -s $SRC/breeze-icons .
# https://bugs.kde.org/show_bug.cgi?id=394204
sed -i -e "s/width: backgroundRect/enabled: root.enabled; width: backgroundRect/g" src/controls/templates/private/PassiveNotification.qml
-# another hack. Do not include the Kirigami resources (on static build). It causes
+# three more hacks - as a diff file for simplicity
+# (1) Do not include the Kirigami resources (on static build). It causes
# double defined symbols in our setting. I would like a nicer fix for this
# issue, but failed to find one. For example, not adding the resource in
# our build causes the qrc file not to be generated. Manual generation
# of the resource file (using rcc) introduces the double symbols again.
# so it seems some Kirigami weirdness (but their staticcmake example compiles
# correctly).
-sed -i -e "s/#include <qrc_kirigami.cpp>/\/\/#include <qrc_kirigami.cpp>/" src/kirigamiplugin.cpp
-# next hack - we want to use the topContent in the GlobalDrawer for our
+# (2) we want to use the topContent in the GlobalDrawer for our
# own image / logo / text (in part because the logo display got broken, in
# part because we want a second line of text to show the account ID
# for this to work we need to remove the margin that the GlobalDrawer
# forces around the topContent
+
+# (3) theming the toolbar fails. It should get the background color from
+# the theme, but somehow that always gets overwritten with the default
+# value for 'active' set in qtquickcontrols2.conf
+
patch -p0 < $SRC/subsurface/scripts/kirigami.diff
popd