diff --git a/mobile-widgets/3rdparty/0001-global-drawer-expose-pop-function.patch b/mobile-widgets/3rdparty/0001-global-drawer-expose-pop-function.patch new file mode 100644 index 000000000..a818b5b9f --- /dev/null +++ b/mobile-widgets/3rdparty/0001-global-drawer-expose-pop-function.patch @@ -0,0 +1,42 @@ +From c0c5903023e24387e509d1e28ca4915d81a30319 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Tue, 24 Nov 2020 20:52:18 -0800 +Subject: [PATCH 01/11] global drawer: expose pop() function + +This allows us to implement our own back button. + +Signed-off-by: Dirk Hohndel +--- + src/controls/GlobalDrawer.qml | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml +index b7163b70..da576177 100644 +--- a/src/controls/GlobalDrawer.qml ++++ b/src/controls/GlobalDrawer.qml +@@ -232,6 +232,13 @@ OverlayDrawer { + */ + property bool isMenu: false + ++ /** ++ * pop: function ++ * ++ * Point to the pop function of the stackView inside the scrollView in order to be able to implement the Back button in the caller ++ */ ++ function pop() { stackView.pop() } ++ + /** + * Notifies that the banner has been clicked + */ +@@ -278,6 +285,8 @@ OverlayDrawer { + topMargin: headerParent.height + headerParent.y + } + ++ function pop() { stackView.pop() } ++ + Flickable { + id: mainFlickable + contentWidth: width +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0002-global-drawer-disable-built-in-back-button.patch b/mobile-widgets/3rdparty/0002-global-drawer-disable-built-in-back-button.patch new file mode 100644 index 000000000..6de6fcf94 --- /dev/null +++ b/mobile-widgets/3rdparty/0002-global-drawer-disable-built-in-back-button.patch @@ -0,0 +1,35 @@ +From a110673e4a98dca385a0e500493e86dcdcd6ddf1 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Tue, 24 Nov 2020 20:52:28 -0800 +Subject: [PATCH 02/11] global drawer: disable built-in back button + +It's really ugly, let's do our own. + +Signed-off-by: Dirk Hohndel +--- + src/controls/GlobalDrawer.qml | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml +index da576177..e2a6d391 100644 +--- a/src/controls/GlobalDrawer.qml ++++ b/src/controls/GlobalDrawer.qml +@@ -464,6 +464,7 @@ OverlayDrawer { + property int level: 0 + Layout.maximumHeight: Layout.minimumHeight + ++/* the Kirigami back item is ugly - we prefer to do our own + BasicListItem { + id: backItem + visible: level > 0 +@@ -482,6 +483,7 @@ OverlayDrawer { + sequence: backItem.MnemonicData.sequence + onActivated: backItem.clicked() + } ++*/ + + Repeater { + id: actionsRepeater +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0003-global-drawer-remove-padding-around-the-title-image.patch b/mobile-widgets/3rdparty/0003-global-drawer-remove-padding-around-the-title-image.patch new file mode 100644 index 000000000..a1f9b8b46 --- /dev/null +++ b/mobile-widgets/3rdparty/0003-global-drawer-remove-padding-around-the-title-image.patch @@ -0,0 +1,38 @@ +From 14fa735a07bab109cb3f1d5a00aba1fe7e2e6382 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Wed, 25 Nov 2020 09:43:00 -0800 +Subject: [PATCH 03/11] global drawer: remove padding around the title image + +This looks simply odd - no idea why that's there. + +Signed-off-by: Dirk Hohndel +--- + src/controls/GlobalDrawer.qml | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/controls/GlobalDrawer.qml b/src/controls/GlobalDrawer.qml +index e2a6d391..456854b5 100644 +--- a/src/controls/GlobalDrawer.qml ++++ b/src/controls/GlobalDrawer.qml +@@ -365,17 +365,13 @@ OverlayDrawer { + ColumnLayout { + 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 + Layout.preferredHeight: implicitHeight * opacity + //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 && opacity > 0 + opacity: !root.collapsed || showTopContentWhenCollapsed + Behavior on opacity { +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0004-action-button-make-wider-for-easier-use.patch b/mobile-widgets/3rdparty/0004-action-button-make-wider-for-easier-use.patch new file mode 100644 index 000000000..4128bdfff --- /dev/null +++ b/mobile-widgets/3rdparty/0004-action-button-make-wider-for-easier-use.patch @@ -0,0 +1,149 @@ +From b23502b18e8170d56a5fdf4d49c923ed674e7f66 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Wed, 25 Nov 2020 13:45:32 -0800 +Subject: [PATCH 04/11] action button: make wider for easier use + +And remove the horrible 'dragging the button opens the drawer' user +experience. That's just unusable on a mobile device. + +Signed-off-by: Dirk Hohndel +--- + src/controls/private/ActionButton.qml | 77 +++++++++------------------ + 1 file changed, 24 insertions(+), 53 deletions(-) + +diff --git a/src/controls/private/ActionButton.qml b/src/controls/private/ActionButton.qml +index 030dae51..60dccb8f 100644 +--- a/src/controls/private/ActionButton.qml ++++ b/src/controls/private/ActionButton.qml +@@ -56,25 +56,9 @@ Item { + + anchors.bottom: edgeMouseArea.bottom + +- implicitWidth: implicitHeight + Units.iconSizes.smallMedium*2 + Units.gridUnit ++ implicitWidth: implicitHeight + Units.iconSizes.smallMedium * 4 + Units.gridUnit + implicitHeight: Units.iconSizes.medium + Units.largeSpacing * 2 + +- +- onXChanged: { +- if (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed) { +- if (root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal) { +- globalDrawer.peeking = true; +- globalDrawer.visible = true; +- globalDrawer.position = Math.min(1, Math.max(0, (x - root.width/2 + button.width/2)/globalDrawer.contentItem.width + mouseArea.drawerShowAdjust)); +- } +- if (root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal) { +- contextDrawer.peeking = true; +- contextDrawer.visible = true; +- contextDrawer.position = Math.min(1, Math.max(0, (root.width/2 - button.width/2 - x)/contextDrawer.contentItem.width + mouseArea.drawerShowAdjust)); +- } +- } +- } +- + MouseArea { + id: mouseArea + anchors.fill: parent +@@ -83,14 +67,6 @@ Item { + property bool internalVisibility: (!root.hasApplicationWindow || (applicationWindow().controlsVisible && applicationWindow().height > root.height*2)) && (root.action === null || root.action.visible === undefined || root.action.visible) + preventStealing: true + +- drag { +- target: button +- //filterChildren: true +- axis: Drag.XAxis +- minimumX: root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2 +- maximumX: root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2 +- } +- + property var downTimestamp; + property int startX + property int startMouseY +@@ -127,30 +103,7 @@ Item { + onReleased: { + if (root.hasGlobalDrawer) globalDrawer.peeking = false; + if (root.hasContextDrawer) contextDrawer.peeking = false; +- //pixel/second +- var x = button.x + button.width/2; +- var speed = ((x - startX) / ((new Date()).getTime() - downTimestamp) * 1000); +- drawerShowAdjust = 0; + +- //project where it would be a full second in the future +- if (root.hasContextDrawer && root.hasGlobalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) { +- globalDrawer.open(); +- contextDrawer.close(); +- } else if (root.hasContextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) { +- if (root.hasContextDrawer && contextDrawer.modal) { +- contextDrawer.open(); +- } +- if (root.hasGlobalDrawer && globalDrawer.modal) { +- globalDrawer.close(); +- } +- } else { +- if (root.hasGlobalDrawer && globalDrawer.modal) { +- globalDrawer.close(); +- } +- if (root.hasContextDrawer && contextDrawer.modal) { +- contextDrawer.close(); +- } +- } + //Don't rely on native onClicked, but fake it here: + //Qt.startDragDistance is not adapted to devices dpi in case + //of Android, so consider the button "clicked" when: +@@ -184,10 +137,6 @@ Item { + } + } + +- onPositionChanged: { +- drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15))); +- button.xChanged(); +- } + onPressAndHold: { + if (!actionUnderMouse) { + return; +@@ -274,7 +223,7 @@ Item { + bottomMargin: Units.smallSpacing + } + enabled: root.leftAction && root.leftAction.enabled +- radius: Units.devicePixelRatio*2 ++ radius: Units.devicePixelRatio*4 + height: Units.iconSizes.smallMedium + Units.smallSpacing * 2 + width: height + (root.action ? Units.gridUnit*2 : 0) + visible: root.leftAction +@@ -309,6 +258,17 @@ Item { + margins: Units.smallSpacing * 2 + } + } ++ Rectangle { ++ anchors.left: parent.left ++ anchors.leftMargin: Units.smallSpacing ++ anchors.verticalCenter: parent.verticalCenter ++ width: Units.iconSizes.smallMedium + Units.smallSpacing * 2 ++ height: width ++ radius: width / 2 ++ color: "transparent" ++ border.color: Qt.lighter(buttonGraphics.baseColor, 1.1) ++ border.width: 0.5 ++ } + } + //right button + Rectangle { +@@ -355,6 +315,17 @@ Item { + margins: Units.smallSpacing * 2 + } + } ++ Rectangle { ++ anchors.right: parent.right ++ anchors.rightMargin: Units.smallSpacing ++ anchors.verticalCenter: parent.verticalCenter ++ width: Units.iconSizes.smallMedium + Units.smallSpacing * 2 ++ height: width ++ radius: width / 2 ++ color: "transparent" ++ border.color: Qt.lighter(buttonGraphics.baseColor, 1.1) ++ border.width: 0.5 ++ } + } + } + +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0005-breadcrumbs-get-better-font-size.patch b/mobile-widgets/3rdparty/0005-breadcrumbs-get-better-font-size.patch new file mode 100644 index 000000000..eceb3a4fd --- /dev/null +++ b/mobile-widgets/3rdparty/0005-breadcrumbs-get-better-font-size.patch @@ -0,0 +1,42 @@ +From 5e745f7a02fd967dbfabeba0871025b1513ce1d4 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Wed, 25 Nov 2020 13:51:35 -0800 +Subject: [PATCH 05/11] breadcrumbs: get better font size + +Signed-off-by: Dirk Hohndel +--- + src/controls/Units.qml | 5 +++++ + src/controls/private/globaltoolbar/BreadcrumbControl.qml | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/src/controls/Units.qml b/src/controls/Units.qml +index 615228a2..f957046f 100644 +--- a/src/controls/Units.qml ++++ b/src/controls/Units.qml +@@ -105,6 +105,11 @@ QtObject { + */ + readonly property int wheelScrollLines: 3 + ++ /** ++ * Use this to hardcode the font size of the global toolbar that Kirigami gets wrong ++ */ ++ property double defaultFontSize: fontMetrics.font.pixelSize ++ + /** + * metrics used by the default font + */ +diff --git a/src/controls/private/globaltoolbar/BreadcrumbControl.qml b/src/controls/private/globaltoolbar/BreadcrumbControl.qml +index ad80d222..c45db280 100644 +--- a/src/controls/private/globaltoolbar/BreadcrumbControl.qml ++++ b/src/controls/private/globaltoolbar/BreadcrumbControl.qml +@@ -69,6 +69,7 @@ Flickable { + } + Kirigami.Heading { + Layout.leftMargin: Kirigami.Units.largeSpacing ++ font.pixelSize: Math.max(1, Kirigami.Units.defaultFontSize) + color: Kirigami.Theme.textColor + verticalAlignment: Text.AlignVCenter + wrapMode: Text.NoWrap +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0006-avatar-apparently-you-can-t-add-QChars-to-make-a-QSt.patch b/mobile-widgets/3rdparty/0006-avatar-apparently-you-can-t-add-QChars-to-make-a-QSt.patch new file mode 100644 index 000000000..4d67e247d --- /dev/null +++ b/mobile-widgets/3rdparty/0006-avatar-apparently-you-can-t-add-QChars-to-make-a-QSt.patch @@ -0,0 +1,54 @@ +From 078197bac6507633833f5275e4ef333975766896 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Thu, 26 Nov 2020 19:35:40 +0000 +Subject: [PATCH 06/11] avatar: apparently you can't add QChars to make a + QString + +I'm a bit surprised that a bug like this would make it into a release. +That makes me think that there's something wrong with the way we compile +this on Android. + +Signed-off-by: Dirk Hohndel +--- + kirigami.pri | 14 +++++++------- + src/avatar.cpp | 2 +- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/kirigami.pri b/kirigami.pri +index 6012f1b9..65a77646 100644 +--- a/kirigami.pri ++++ b/kirigami.pri +@@ -70,10 +70,10 @@ API_VER=1.0 + + RESOURCES += $$PWD/kirigami.qrc $$PWD/src/scenegraph/shaders/shaders.qrc + +-exists($$_PRO_FILE_PWD_/kirigami-icons.qrc) { +- message("Using icons QRC file shipped by the project") +- RESOURCES += $$_PRO_FILE_PWD_/kirigami-icons.qrc +-} else { +- message("Using icons QRCfile shipped in kirigami") +- RESOURCES += $$PWD/kirigami-icons.qrc +-} ++# exists($$_PRO_FILE_PWD_/kirigami-icons.qrc) { ++# message("Using icons QRC file shipped by the project") ++# RESOURCES += $$_PRO_FILE_PWD_/kirigami-icons.qrc ++# } else { ++# message("Using icons QRCfile shipped in kirigami") ++# RESOURCES += $$PWD/kirigami-icons.qrc ++# } +diff --git a/src/avatar.cpp b/src/avatar.cpp +index 13ab2825..d660c635 100644 +--- a/src/avatar.cpp ++++ b/src/avatar.cpp +@@ -49,7 +49,7 @@ QString AvatarPrivate::initialsFromString(const QString& string) + return QString(first.front()); + } + // "FirstName" "LastName" -> "FL" +- return first.front() + last.front(); ++ return QString(first.front()) + last.front(); + // "OneName" + } else { + // "OneName" -> "O" +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0007-breadcrumbs-deal-with-incorrect-height-of-title-bar.patch b/mobile-widgets/3rdparty/0007-breadcrumbs-deal-with-incorrect-height-of-title-bar.patch new file mode 100644 index 000000000..f1fae6fbc --- /dev/null +++ b/mobile-widgets/3rdparty/0007-breadcrumbs-deal-with-incorrect-height-of-title-bar.patch @@ -0,0 +1,109 @@ +From 766da540c8859cc0983b73726dab3ce743109c16 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Thu, 3 Dec 2020 13:51:36 -0800 +Subject: [PATCH 07/11] breadcrumbs: deal with incorrect height of title bar + +I can see that the Kirigami developers have made changes here, but +this still doesn't work without that invisible element. + +This also hardcodes our background color for the title bar as that +theming always goes wrong. + +Signed-off-by: Dirk Hohndel +--- + .../globaltoolbar/PageRowGlobalToolBarUI.qml | 18 +++++++++++++++--- + src/controls/templates/private/BackButton.qml | 1 + + .../templates/private/ForwardButton.qml | 1 + + 3 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml +index 4404faae..e0b26e88 100644 +--- a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml ++++ b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml +@@ -28,6 +28,7 @@ Kirigami.AbstractApplicationHeader { + preferredHeight: globalToolBar.preferredHeight + maximumHeight: globalToolBar.maximumHeight + separatorVisible: globalToolBar.separatorVisible ++ background: Rectangle { color: subsurfaceTheme.primaryColor } + + Kirigami.Theme.textColor: currentItem ? currentItem.Kirigami.Theme.textColor : parent.Kirigami.Theme.textColor + +@@ -35,6 +36,14 @@ Kirigami.AbstractApplicationHeader { + anchors.fill: parent + spacing: 0 + ++ // I can't make the layout work without this invisible rectangle to anchor things on ++ Rectangle { ++ id: correct ++ height: parent.height ++ width: 0 ++ color: "transparent" ++ } ++ + Item { + id: leftHandleAnchor + visible: (typeof applicationWindow() !== "undefined" && applicationWindow().globalDrawer && applicationWindow().globalDrawer.enabled && applicationWindow().globalDrawer.handleVisible && +@@ -67,6 +76,7 @@ Kirigami.AbstractApplicationHeader { + Layout.fillHeight: true + + Layout.leftMargin: leftHandleAnchor.visible ? Kirigami.Units.smallSpacing : 0 ++ Layout.alignment: Qt.AlignTop | Qt.AlignVCenter + + visible: (globalToolBar.showNavigationButtons != Kirigami.ApplicationHeaderStyle.NoNavigationButtons || root.layers.depth > 0) && (globalToolBar.actualStyle != Kirigami.ApplicationHeaderStyle.None) + +@@ -76,16 +86,18 @@ Kirigami.AbstractApplicationHeader { + id: backButton + Layout.leftMargin: leftHandleAnchor.visible ? 0 : Kirigami.Units.smallSpacing + Layout.preferredWidth: height +- Layout.maximumHeight: buttonsLayout.height ++ Layout.topMargin: 0 ++ Layout.maximumHeight: correct.height + } + TemplatesPrivate.ForwardButton { +- Layout.maximumHeight: buttonsLayout.height ++ Layout.maximumHeight: correct.height + Layout.preferredWidth: height + } + } + + QQC2.ToolSeparator { + visible: (menuButton.visible || (buttonsLayout.visible && buttonsLayout.visibleChildren.length > 0)) && breadcrumbVisible && pageRow.depth > 1 ++ Layout.maximumHeight: correct.height + } + + Loader { +@@ -124,6 +136,6 @@ Kirigami.AbstractApplicationHeader { + Layout.preferredWidth: height + } + } +- background.opacity: breadcrumbLoader.opacity ++ //background.opacity: breadcrumbLoader.opacity + } + +diff --git a/src/controls/templates/private/BackButton.qml b/src/controls/templates/private/BackButton.qml +index 85a46d15..d1076080 100644 +--- a/src/controls/templates/private/BackButton.qml ++++ b/src/controls/templates/private/BackButton.qml +@@ -14,6 +14,7 @@ Controls.ToolButton { + id: button + + icon.name: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic") ++ icon.source: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic") + + enabled: applicationWindow().pageStack.layers.depth > 1 || (applicationWindow().pageStack.depth > 1 && (applicationWindow().pageStack.currentIndex > 0 || applicationWindow().pageStack.contentItem.contentX > 0)) + +diff --git a/src/controls/templates/private/ForwardButton.qml b/src/controls/templates/private/ForwardButton.qml +index c756e030..68a3901b 100644 +--- a/src/controls/templates/private/ForwardButton.qml ++++ b/src/controls/templates/private/ForwardButton.qml +@@ -14,6 +14,7 @@ Controls.ToolButton { + id: button + + icon.name: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") ++ icon.source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") + + enabled: applicationWindow().pageStack.currentIndex < applicationWindow().pageStack.depth-1 + +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0008-include-the-shared-not-shared-result-in-log.patch b/mobile-widgets/3rdparty/0008-include-the-shared-not-shared-result-in-log.patch new file mode 100644 index 000000000..38bb2aa7d --- /dev/null +++ b/mobile-widgets/3rdparty/0008-include-the-shared-not-shared-result-in-log.patch @@ -0,0 +1,33 @@ +From a17a22e08e3398b243dbc369a8ff4c790c58db44 Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Thu, 3 Dec 2020 15:01:18 -0800 +Subject: [PATCH 08/11] include the shared / not shared result in log + +We shouldn't be building Kirigami as shared library, yet that's +what makes our GitHub builds fail. + +Signed-off-by: Dirk Hohndel +--- + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9f1404ac..6e4f4bba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -37,9 +37,12 @@ set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + + if(NOT BUILD_SHARED_LIBS) ++ message(STATUS "Static build of libkirigami") + add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC) + add_definitions(-DQT_PLUGIN) + add_definitions(-DQT_STATICPLUGIN=1) ++else() ++ message(STATUS "Shared build of libkirigami -- BUILD_SHARED_LIBS is \"${BUILD_SHARED_LIBS}\"") + endif() + + ################# set KDE specific information ################# +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0009-qmake-build-add-missing-sizegroup-source-header.patch b/mobile-widgets/3rdparty/0009-qmake-build-add-missing-sizegroup-source-header.patch new file mode 100644 index 000000000..0f4b2f8ed --- /dev/null +++ b/mobile-widgets/3rdparty/0009-qmake-build-add-missing-sizegroup-source-header.patch @@ -0,0 +1,35 @@ +From d3243df32cae73201d93da366893c969ef574e8f Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Sat, 12 Dec 2020 10:48:24 -0800 +Subject: [PATCH 09/11] qmake build: add missing sizegroup source/header + +This seems to have been missed in commit bbca96262e ("Introduce SizeGroup"). + +Signed-off-by: Dirk Hohndel +--- + kirigami.pri | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/kirigami.pri b/kirigami.pri +index 65a77646..35c4a34d 100644 +--- a/kirigami.pri ++++ b/kirigami.pri +@@ -26,6 +26,7 @@ HEADERS += $$PWD/src/kirigamiplugin.h \ + $$PWD/src/wheelhandler.h \ + $$PWD/src/shadowedrectangle.h \ + $$PWD/src/shadowedtexture.h \ ++ $$PWD/src/sizegroup.h \ + $$PWD/src/pagerouter.h \ + $$PWD/src/pagepool.h \ + $$PWD/src/avatar.h \ +@@ -57,6 +58,7 @@ SOURCES += $$PWD/src/kirigamiplugin.cpp \ + $$PWD/src/wheelhandler.cpp \ + $$PWD/src/shadowedrectangle.cpp \ + $$PWD/src/shadowedtexture.cpp \ ++ $$PWD/src/sizegroup.cpp \ + $$PWD/src/pagerouter.cpp \ + $$PWD/src/pagepool.cpp \ + $$PWD/src/avatar.cpp \ +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0010-don-t-use-yet.patch b/mobile-widgets/3rdparty/0010-don-t-use-yet.patch new file mode 100644 index 000000000..adc48d69a --- /dev/null +++ b/mobile-widgets/3rdparty/0010-don-t-use-yet.patch @@ -0,0 +1,26 @@ +From 4c364152dcff6de56c8356922f48c2c069c71ef2 Mon Sep 17 00:00:00 2001 +From: Marco Martin +Date: Mon, 14 Dec 2020 11:07:06 +0100 +Subject: [PATCH 10/11] don't use ?? yet + +--- + src/controls/AbstractApplicationItem.qml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/controls/AbstractApplicationItem.qml b/src/controls/AbstractApplicationItem.qml +index 718ecd6e..fecc431a 100644 +--- a/src/controls/AbstractApplicationItem.qml ++++ b/src/controls/AbstractApplicationItem.qml +@@ -191,7 +191,8 @@ Item { + menuBar.position = T.DialogButtonBox.Footer + } + menuBar.width = Qt.binding(() => root.contentItem.width) +- menuBar.y = Qt.binding(() => -menuBar.height - (root.header.height ?? 0)) ++ //FIXME: (root.header.height ?? 0) when we can depend from 5.15 ++ menuBar.y = Qt.binding(() => -menuBar.height - (root.header.height ? root.header.height : 0)) + } + + /** +-- +2.25.1 + diff --git a/mobile-widgets/3rdparty/0011-ensure-forward-backward-arrows-are-rendered.patch b/mobile-widgets/3rdparty/0011-ensure-forward-backward-arrows-are-rendered.patch new file mode 100644 index 000000000..773beb7bc --- /dev/null +++ b/mobile-widgets/3rdparty/0011-ensure-forward-backward-arrows-are-rendered.patch @@ -0,0 +1,57 @@ +From cc0022ca9f4541c2a9f9f42598e2df411753b0ef Mon Sep 17 00:00:00 2001 +From: Dirk Hohndel +Date: Wed, 16 Dec 2020 14:58:10 -0800 +Subject: [PATCH 11/11] ensure forward / backward arrows are rendered + +For inexplicable reasons, on iOS (and macOS) the go-next / go-previous icons +aren't found without the explicit path. + +Signed-off-by: Dirk Hohndel +--- + src/controls/private/GlobalDrawerActionItem.qml | 2 +- + src/controls/private/globaltoolbar/BreadcrumbControl.qml | 2 +- + src/controls/templates/ApplicationHeader.qml | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/controls/private/GlobalDrawerActionItem.qml b/src/controls/private/GlobalDrawerActionItem.qml +index cb1e5f37..f18d0a3a 100644 +--- a/src/controls/private/GlobalDrawerActionItem.qml ++++ b/src/controls/private/GlobalDrawerActionItem.qml +@@ -73,7 +73,7 @@ AbstractListItem { + opacity: 0.7 + selected: listItem.checked || listItem.pressed + Layout.preferredWidth: Layout.preferredHeight +- source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") ++ source: (LayoutMirroring.enabled ? ":/go-next-symbolic-rtl" : ":/go-next-symbolic") + visible: (!isExpandible || root.collapsed) && !listItem.isSeparator && modelData.hasOwnProperty("children") && modelData.children!==undefined && modelData.children.length > 0 + } + } +diff --git a/src/controls/private/globaltoolbar/BreadcrumbControl.qml b/src/controls/private/globaltoolbar/BreadcrumbControl.qml +index c45db280..8d3613fb 100644 +--- a/src/controls/private/globaltoolbar/BreadcrumbControl.qml ++++ b/src/controls/private/globaltoolbar/BreadcrumbControl.qml +@@ -65,7 +65,7 @@ Flickable { + Layout.preferredWidth: Layout.preferredHeight + isMask: true + color: Kirigami.Theme.textColor +- source: LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic" ++ source: LayoutMirroring.enabled ? ":/go-next-symbolic-rtl" : ":/go-next-symbolic" + } + Kirigami.Heading { + Layout.leftMargin: Kirigami.Units.largeSpacing +diff --git a/src/controls/templates/ApplicationHeader.qml b/src/controls/templates/ApplicationHeader.qml +index daad0a29..3c4b32f8 100644 +--- a/src/controls/templates/ApplicationHeader.qml ++++ b/src/controls/templates/ApplicationHeader.qml +@@ -69,7 +69,7 @@ AbstractApplicationHeader { + height: Units.iconSizes.small + width: height + selected: header.background && header.background.color && header.background.color === Theme.highlightColor +- source: titleList.isTabBar ? "" : (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") ++ source: titleList.isTabBar ? "" : (LayoutMirroring.enabled ? ":/go-next-symbolic-rtl" : ":/go-next-symbolic") + } + + Heading { +-- +2.25.1 + diff --git a/scripts/kirigami.diff b/scripts/kirigami.diff deleted file mode 100644 index 1f8889275..000000000 --- a/scripts/kirigami.diff +++ /dev/null @@ -1,345 +0,0 @@ -diff -rwu ../kirigami/src/controls/GlobalDrawer.qml ./src/controls/GlobalDrawer.qml ---- ../kirigami/src/controls/GlobalDrawer.qml 2019-10-10 17:13:41.384333413 -0700 -+++ ./src/controls/GlobalDrawer.qml 2019-10-11 19:44:58.988220651 -0700 -@@ -215,6 +215,20 @@ - readonly property Action currentSubMenu: stackView.currentItem ? stackView.currentItem.current: null - - /** -+ * scrollViewItem: ScrollView -+ * -+ * Points to the internal ScrollView so the caller can implement the Back button -+ */ -+ readonly property Item scrollViewItem: scrollView -+ -+ /** -+ * pop: function -+ * -+ * Point to the pop function of the stackView inside the scrollView in order to be able to implement the Back button in the caller -+ */ -+ function pop() { scrollView.pop } -+ -+ /** - * Notifies that the banner has been clicked - */ - signal bannerClicked() -@@ -238,6 +252,7 @@ - anchors.fill: parent - implicitWidth: Math.min (Units.gridUnit * 20, root.parent.width * 0.8) - horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff -+ function pop() { stackView.pop() } - - Flickable { - id: mainFlickable -@@ -331,17 +346,13 @@ - ColumnLayout { - 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 - Layout.preferredHeight: implicitHeight * opacity - //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 && opacity > 0 - opacity: !root.collapsed || showTopContentWhenCollapsed - Behavior on opacity { -@@ -435,7 +446,7 @@ - easing.type: Easing.InOutQuad - } - } -- -+/* - BasicListItem { - id: backItem - visible: level > 0 -@@ -454,7 +465,7 @@ - sequence: backItem.MnemonicData.sequence - onActivated: backItem.clicked() - } -- -+*/ - Repeater { - id: actionsRepeater - model: root.actions -diff -rwu ../kirigami/src/controls/private/GlobalDrawerActionItem.qml ./src/controls/private/GlobalDrawerActionItem.qml ---- ../kirigami/src/controls/private/GlobalDrawerActionItem.qml 2019-10-10 17:13:41.387666766 -0700 -+++ ./src/controls/private/GlobalDrawerActionItem.qml 2019-10-11 19:44:58.988220651 -0700 -@@ -94,7 +94,7 @@ - Layout.preferredHeight: !root.collapsed ? Units.iconSizes.smallMedium : Units.iconSizes.small/2 - selected: listItem.checked || listItem.pressed - Layout.preferredWidth: Layout.preferredHeight -- source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") -+ source: (LayoutMirroring.enabled ? ":/go-next-symbolic-rtl" : ":/go-next-symbolic") - visible: (!isExpandible || root.collapsed) && !listItem.isSeparator && modelData.hasOwnProperty("children") && modelData.children!==undefined && modelData.children.length > 0 - } - data: [ -diff -rwu ../kirigami/src/controls/private/globaltoolbar/BreadcrumbControl.qml ./src/controls/private/globaltoolbar/BreadcrumbControl.qml ---- ../kirigami/src/controls/private/globaltoolbar/BreadcrumbControl.qml 2019-10-10 17:13:41.391000120 -0700 -+++ ./src/controls/private/globaltoolbar/BreadcrumbControl.qml 2019-10-11 22:59:45.248031517 -0700 -@@ -82,7 +81,7 @@ - Kirigami.Heading { - Layout.leftMargin: Kirigami.Units.largeSpacing - font.pointSize: -1 -- font.pixelSize: Math.max(1, mainLayout.height * 0.6) -+ font.pixelSize: Math.max(1, Kirigami.Units.defaultFontSize) - color: Kirigami.Theme.textColor - verticalAlignment: Text.AlignVCenter - wrapMode: Text.NoWrap -diff -rwu ../kirigami/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml ./src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml ---- ../kirigami/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml 2019-10-10 17:13:41.391000120 -0700 -+++ ./src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml 2019-10-12 10:36:39.396460010 -0700 -@@ -36,15 +36,23 @@ - readonly property Item currentItem: layerIsMainRow ? root.currentItem : root.layers.currentItem - - height: visible ? implicitHeight : 0 -+ - minimumHeight: globalToolBar.minimumHeight - preferredHeight: globalToolBar.preferredHeight - maximumHeight: globalToolBar.maximumHeight - separatorVisible: globalToolBar.separatorVisible -+ background: Rectangle { color: subsurfaceTheme.primaryColor } - - RowLayout { - anchors.fill: parent - spacing: 0 -- -+ // I can't make the layout work without this invisible rectangle to anchor things on -+ Rectangle { -+ id: correct -+ height: parent.height -+ width: 0 -+ color: "transparent" -+ } - Item { - id: leftHandleAnchor - visible: (typeof applicationWindow() !== "undefined" && applicationWindow().globalDrawer && applicationWindow().globalDrawer.enabled && applicationWindow().globalDrawer.handleVisible && -@@ -60,20 +68,21 @@ - RowLayout { - id: buttonsLayout - Layout.fillHeight: true -- - Layout.leftMargin: leftHandleAnchor.visible ? Kirigami.Units.smallSpacing : 0 -- -+ Layout.alignment: Qt.AlignTop | Qt.AlignVCenter - visible: (globalToolBar.showNavigationButtons != Kirigami.ApplicationHeaderStyle.NoNavigationButtons || root.layers.depth > 1) && (globalToolBar.actualStyle != Kirigami.ApplicationHeaderStyle.None) - - Layout.maximumWidth: visibleChildren.length > 0 ? implicitWidth : 0 -- - TemplatesPrivate.BackButton { - id: backButton - Layout.leftMargin: leftHandleAnchor.visible ? 0 : Kirigami.Units.smallSpacing - Layout.preferredWidth: height -+ Layout.topMargin: 0 -+ Layout.maximumHeight: correct.height - } - TemplatesPrivate.ForwardButton { - Layout.preferredWidth: height -+ Layout.maximumHeight: correct.height - } - } - -@@ -110,6 +119,6 @@ - Layout.preferredWidth: height - } - } -- background.opacity: breadcrumbLoader.opacity -+ //background.opacity: breadcrumbLoader.opacity - } - -diff -rwu ../kirigami/src/controls/templates/private/BackButton.qml ./src/controls/templates/private/BackButton.qml ---- ../kirigami/src/controls/templates/private/BackButton.qml 2019-10-10 17:13:41.391000120 -0700 -+++ ./src/controls/templates/private/BackButton.qml 2019-10-12 10:32:00.517728443 -0700 -@@ -27,6 +27,7 @@ - id: button - - icon.name: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic") -+ icon.source: (LayoutMirroring.enabled ? "go-previous-symbolic-rtl" : "go-previous-symbolic") - - enabled: applicationWindow().pageStack.layers.depth > 1 || (applicationWindow().pageStack.depth > 1 && (applicationWindow().pageStack.currentIndex > 0 || applicationWindow().pageStack.contentItem.contentX > 0)) - -diff -rwu ../kirigami/src/controls/templates/private/ForwardButton.qml ./src/controls/templates/private/ForwardButton.qml ---- ../kirigami/src/controls/templates/private/ForwardButton.qml 2019-10-10 17:13:41.391000120 -0700 -+++ ./src/controls/templates/private/ForwardButton.qml 2019-10-11 19:44:58.988220651 -0700 -@@ -27,6 +27,7 @@ - id: button - - icon.name: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") -+ icon.source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic") - - enabled: applicationWindow().pageStack.currentIndex < applicationWindow().pageStack.depth-1 - -diff -rwu ../kirigami/src/controls/Units.qml ./src/controls/Units.qml ---- ../kirigami/src/controls/Units.qml 2019-10-10 17:13:41.387666766 -0700 -+++ ./src/controls/Units.qml 2019-10-11 20:48:07.216139938 -0700 -@@ -113,6 +113,11 @@ - readonly property int wheelScrollLines: 3 - - /** -+ * Use this to hardcode the font size of the global toolbar that Kirigami gets wrong -+ */ -+ property double defaultFontSize: fontMetrics.font.pixelSize -+ -+ /** - * metrics used by the default font - */ - property variant fontMetrics: TextMetrics { -diff -rwu ../kirigami/src/kirigamiplugin.cpp ./src/kirigamiplugin.cpp ---- ../kirigami/src/kirigamiplugin.cpp 2019-10-10 17:13:41.391000120 -0700 -+++ ./src/kirigamiplugin.cpp 2019-10-11 19:44:58.991554017 -0700 -@@ -41,7 +41,7 @@ - - //Q_INIT_RESOURCE(kirigami); - #ifdef KIRIGAMI_BUILD_TYPE_STATIC --#include -+//#include - #endif - - QUrl KirigamiPlugin::componentUrl(const QString &fileName) const -diff -rwu ../kirigami/src/controls/private/ActionButton.qml ./src/controls/private/ActionButton.qml ---- ../kirigami/src/controls/private/ActionButton.qml 2019-10-11 14:00:51.783839545 -0400 -+++ ./src/controls/private/ActionButton.qml 2019-10-27 17:12:04.339302719 -0400 -@@ -70,12 +70,12 @@ - - anchors.bottom: edgeMouseArea.bottom - -- implicitWidth: implicitHeight + Units.iconSizes.smallMedium*2 + Units.gridUnit -+ implicitWidth: implicitHeight + Units.iconSizes.smallMedium*4 + Units.gridUnit - implicitHeight: Units.iconSizes.medium + Units.largeSpacing * 2 - - - onXChanged: { -- if (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed) { -+ if (0 && (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed)) { - if (root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal) { - globalDrawer.peeking = true; - globalDrawer.visible = true; -@@ -97,13 +97,13 @@ - property bool internalVisibility: (!root.hasApplicationWindow || (applicationWindow().controlsVisible && applicationWindow().height > root.height*2)) && (root.action === null || root.action.visible === undefined || root.action.visible) - preventStealing: true - -- drag { -- target: button -- //filterChildren: true -- axis: Drag.XAxis -- minimumX: root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2 -- maximumX: root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2 -- } -+// drag { -+// target: button -+// //filterChildren: true -+// axis: Drag.XAxis -+// minimumX: root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2 -+// maximumX: root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2 -+// } - - property var downTimestamp; - property int startX -@@ -147,24 +147,24 @@ - drawerShowAdjust = 0; - - //project where it would be a full second in the future -- if (root.hasContextDrawer && root.hasGlobalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) { -- globalDrawer.open(); -- contextDrawer.close(); -- } else if (root.hasContextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) { -- if (root.hasContextDrawer && contextDrawer.modal) { -- contextDrawer.open(); -- } -- if (root.hasGlobalDrawer && globalDrawer.modal) { -- globalDrawer.close(); -- } -- } else { -- if (root.hasGlobalDrawer && globalDrawer.modal) { -- globalDrawer.close(); -- } -- if (root.hasContextDrawer && contextDrawer.modal) { -- contextDrawer.close(); -- } -- } -+// if (root.hasContextDrawer && root.hasGlobalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) { -+// globalDrawer.open(); -+// contextDrawer.close(); -+// } else if (root.hasContextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) { -+// if (root.hasContextDrawer && contextDrawer.modal) { -+// contextDrawer.open(); -+// } -+// if (root.hasGlobalDrawer && globalDrawer.modal) { -+// globalDrawer.close(); -+// } -+// } else { -+// if (root.hasGlobalDrawer && globalDrawer.modal) { -+// globalDrawer.close(); -+// } -+// if (root.hasContextDrawer && contextDrawer.modal) { -+// contextDrawer.close(); -+// } -+// } - //Don't rely on native onClicked, but fake it here: - //Qt.startDragDistance is not adapted to devices dpi in case - //of Android, so consider the button "clicked" when: -@@ -201,10 +201,10 @@ - } - } - -- onPositionChanged: { -- drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15))); -- button.xChanged(); -- } -+// onPositionChanged: { -+// drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15))); -+// button.xChanged(); -+// } - onPressAndHold: { - if (!actionUnderMouse) { - return; -@@ -291,7 +291,7 @@ - bottomMargin: Units.smallSpacing - } - enabled: root.leftAction && root.leftAction.enabled -- radius: Units.devicePixelRatio*2 -+ radius: Units.devicePixelRatio*4 - height: Units.iconSizes.smallMedium + Units.smallSpacing * 2 - width: height + (root.action ? Units.gridUnit*2 : 0) - visible: root.leftAction -@@ -326,6 +326,17 @@ - margins: Units.smallSpacing * 2 - } - } -+ Rectangle { -+ anchors.left: parent.left -+ anchors.leftMargin: Units.smallSpacing -+ anchors.verticalCenter: parent.verticalCenter -+ width: Units.iconSizes.smallMedium + Units.smallSpacing * 2 -+ height: width -+ radius: width / 2 -+ color: "transparent" -+ border.color: Qt.lighter(buttonGraphics.baseColor, 1.1) -+ border.width: 0.5 -+ } - } - //right button - Rectangle { -@@ -372,6 +383,17 @@ - margins: Units.smallSpacing * 2 - } - } -+ Rectangle { -+ anchors.right: parent.right -+ anchors.rightMargin: Units.smallSpacing -+ anchors.verticalCenter: parent.verticalCenter -+ width: Units.iconSizes.smallMedium + Units.smallSpacing * 2 -+ height: width -+ radius: width / 2 -+ color: "transparent" -+ border.color: Qt.lighter(buttonGraphics.baseColor, 1.1) -+ border.width: 0.5 -+ } - } - } - diff --git a/scripts/mobilecomponents.sh b/scripts/mobilecomponents.sh index 3086b0770..ad6c4a370 100755 --- a/scripts/mobilecomponents.sh +++ b/scripts/mobilecomponents.sh @@ -27,6 +27,14 @@ cd "$SRC"/subsurface/mobile-widgets/3rdparty/ECM cmake -DSHARE_INSTALL_DIR=.. ../extra-cmake-modules make install +# finally, add our patches to Kirigami +cd "$SRC"/subsurface/mobile-widgets/3rdparty +PATCHES=$(echo 00*.patch) +cd kirigami +for i in $PATCHES +do + git am ../$i +done exit 0