summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-17 05:59:02 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-18 06:32:23 +0900
commit0b16b547ae2aefb169e5221f103865e1c39a58fc (patch)
treeb40718c65b881463a39c8910eb7080d210066a86 /scripts
parent1501c8fbc7c783e5ee716ace872565774644317d (diff)
downloadsubsurface-0b16b547ae2aefb169e5221f103865e1c39a58fc.tar.gz
build-system: add another Kirigami hack
We want to be able to roll our own banner image, logo, title, and other information in the GlobalDrawer - but Kirigami adds an ugly margin around that. This attempts to remove that margin (but for some reason there is still a margin on the left side). This requires the patch command to be installed, but because of the context sensitivity of the changes, I couldn't figure out how to do this with sed or perl (which we already require). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kirigami.diff20
-rwxr-xr-xscripts/mobilecomponents.sh8
2 files changed, 28 insertions, 0 deletions
diff --git a/scripts/kirigami.diff b/scripts/kirigami.diff
new file mode 100644
index 000000000..daa42841b
--- /dev/null
+++ b/scripts/kirigami.diff
@@ -0,0 +1,20 @@
+diff -ur ../kirigami/src/controls/GlobalDrawer.qml mobile-widgets/qml/kirigami/src/controls/GlobalDrawer.qml
+--- ../kirigami/src/controls/GlobalDrawer.qml 2018-06-16 16:18:42.000000000 +0900
++++ src/controls/GlobalDrawer.qml 2018-06-17 05:05:31.000000000 +0900
+@@ -249,15 +249,11 @@
+ id: topContent
+ spacing: 0
+- Layout.alignment: Qt.AlignHCenter
+- Layout.leftMargin: root.leftPadding
+- Layout.rightMargin: root.rightPadding
+ Layout.bottomMargin: Units.smallSpacing
+- Layout.topMargin: root.topPadding
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ //NOTE: why this? just Layout.fillWidth: true doesn't seem sufficient
+ //as items are added only after this column creation
+- Layout.minimumWidth: parent.width - root.leftPadding - root.rightPadding
++ Layout.minimumWidth: parent.width
+ visible: children.length > 0 && childrenRect.height > 0
+ }
+
diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh
index b23a7ebdc..25ef29b07 100755
--- a/scripts/mobilecomponents.sh
+++ b/scripts/mobilecomponents.sh
@@ -70,6 +70,14 @@ sed -i -e "s/width: backgroundRect/enabled: root.enabled; width: backgroundRe
# 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
+# 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
+patch -p0 < $SRC/subsurface/scripts/kirigami.diff
+
popd
echo org.kde.plasma.kirigami synced from upstream