[neon/kde/kirigami/Neon/release] debian/patches: patch requested by author

Jonathan Riddell null at kde.org
Mon Oct 11 16:17:28 BST 2021


Git commit 9ce5652cc0098e3889161d3586630724d3e69a94 by Jonathan Riddell.
Committed on 11/10/2021 at 15:17.
Pushed by jriddell into branch 'Neon/release'.

patch requested by author

A  +170  -0    debian/patches/nasty-bugs.diff

https://invent.kde.org/neon/kde/kirigami/commit/9ce5652cc0098e3889161d3586630724d3e69a94

diff --git a/debian/patches/nasty-bugs.diff b/debian/patches/nasty-bugs.diff
new file mode 100644
index 0000000..c42f5b6
--- /dev/null
+++ b/debian/patches/nasty-bugs.diff
@@ -0,0 +1,170 @@
+commit e7ffa04038307efef10c1682042e795d4a32a935
+Author: Carl Schwan <carl at carlschwan.eu>
+Date:   Sat Oct 2 19:17:30 2021 +0200
+
+    Fix issues with setting components on tablet
+    
+    * On mobile when clicking on a setting category, the PageRow doesn't
+      switch 90% of the time back to the setting categories page. This was
+      caused by snapToItem being called even when not dragging.
+      This also makes sure that the first selected seting category is
+      selected, as soon as the dialog is big enough (when created the page
+      row has a size of 0 and only when attached to the dialog it get its
+      correct size).
+    * On tablet, the setting dialog has now the ApplicationWindow.overlay
+      has parent. This makes sure that the drawers are not taking in count
+      when centering the dialog. The dialog also doesn't have a double
+      header anymore caused by the missing title property and an empty
+      toolbar being displayed.
+
+diff --git a/src/columnview.cpp b/src/columnview.cpp
+index a95d6e5f..e8498046 100644
+--- a/src/columnview.cpp
++++ b/src/columnview.cpp
+@@ -9,7 +9,6 @@
+ 
+ #include "loggingcategory.h"
+ #include <QAbstractItemModel>
+-#include <QDebug>
+ #include <QGuiApplication>
+ #include <QPropertyAnimation>
+ #include <QQmlComponent>
+@@ -1431,9 +1430,9 @@ bool ColumnView::childMouseEventFilter(QQuickItem *item, QEvent *event)
+ 
+         m_mouseDown = false;
+ 
+-        m_contentItem->snapToItem();
+-        m_contentItem->m_lastDragDelta = 0;
+         if (m_dragging) {
++            m_contentItem->snapToItem();
++            m_contentItem->m_lastDragDelta = 0;
+             m_dragging = false;
+             Q_EMIT draggingChanged();
+         }
+diff --git a/src/controls/PagePoolAction.qml b/src/controls/PagePoolAction.qml
+index 626909c0..4f9b04ed 100644
+--- a/src/controls/PagePoolAction.qml
++++ b/src/controls/PagePoolAction.qml
+@@ -136,7 +136,6 @@ Kirigami.Action {
+             pageStack_.push(initialProperties ?
+                                pagePool.loadPageWithProperties(page, initialProperties) :
+                                pagePool.loadPage(page));
+-                               
+         } else {
+             var callback = function(item) {
+                 if (basePage) {
+diff --git a/src/controls/PageRow.qml b/src/controls/PageRow.qml
+index 06af134d..a47f1cff 100644
+--- a/src/controls/PageRow.qml
++++ b/src/controls/PageRow.qml
+@@ -259,6 +259,7 @@ T.Control {
+                         id: dialog
+                         modal: true;
+                         leftPadding: 0; rightPadding: 0; topPadding: 0; bottomPadding: 0;
++                        clip: true
+                         header: Kirigami.AbstractApplicationHeader {
+                             pageRow: null
+                             page: null
+@@ -301,8 +302,7 @@ T.Control {
+                                 }
+                             }
+                         }
+-                    }', root);
+-                dialog.parent = root;
++                    }', QQC2.ApplicationWindow.overlay);
+                 dialog.width = Qt.binding(() => QQC2.ApplicationWindow.window.width - Units.gridUnit * 5);
+                 dialog.height = Qt.binding(() => QQC2.ApplicationWindow.window.height - Units.gridUnit * 5);
+                 dialog.x = Units.gridUnit * 2.5;
+@@ -320,6 +320,11 @@ T.Control {
+                 }
+                 dialog.contentItem = item;
+                 dialog.title = Qt.binding(() => dialog.contentItem.title);
++
++                // Pushing a PageRow is supported but without PageRow toolbar
++                if (item.globalToolBar && item.globalToolBar.style) {
++                    item.globalToolBar.style = ApplicationHeaderStyle.None
++                }
+                 Object.defineProperty(item, 'closeDialog', {
+                     value: function() {
+                         dialog.close();
+diff --git a/src/controls/private/globaltoolbar/BreadcrumbControl.qml b/src/controls/private/globaltoolbar/BreadcrumbControl.qml
+index ae9d2629..55649aa5 100644
+--- a/src/controls/private/globaltoolbar/BreadcrumbControl.qml
++++ b/src/controls/private/globaltoolbar/BreadcrumbControl.qml
+@@ -68,7 +68,8 @@ Flickable {
+                 RowLayout {
+                     id: delegateLayout
+                     anchors.fill: parent
+-                    readonly property Kirigami.Page page: mainRepeater.useLayers ? pageRow.layers.get(modelData + 1) : pageRow.get(modelData)
++                    // We can't use Kirigami.Page here instead of Item since we now accept pushing PageRow to a new layer
++                    readonly property Item page: mainRepeater.useLayers ? pageRow.layers.get(modelData + 1) : pageRow.get(modelData)
+                     spacing: 0
+ 
+                     Kirigami.Icon {
+diff --git a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
+index 6b249454..640ab51e 100644
+--- a/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
++++ b/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml
+@@ -64,7 +64,7 @@ Kirigami.AbstractApplicationHeader {
+             Layout.leftMargin: Kirigami.Units.smallSpacing
+ 
+             action: Kirigami.Action {
+-                children: applicationWindow().globalDrawer ? applicationWindow().globalDrawer.actions : []
++                children: applicationWindow().globalDrawer && applicationWindow().globalDrawer.actions ? applicationWindow().globalDrawer.actions : []
+             }
+         }
+ 
+diff --git a/src/controls/settingscomponents/CategorizedSettings.qml b/src/controls/settingscomponents/CategorizedSettings.qml
+index b09eb060..fdca2c06 100644
+--- a/src/controls/settingscomponents/CategorizedSettings.qml
++++ b/src/controls/settingscomponents/CategorizedSettings.qml
+@@ -24,7 +24,9 @@ PageRow {
+ 
+     property list<PagePoolAction> actions
+     property alias stack: pageSettingStack
+-    property alias pool: pageSettingsPool
++    property PagePool pool: PagePool {}
++
++    readonly property string title: pageSettingStack.depth < 2 ? qsTr("Settings") : qsTr("Settings — %1").arg(pageSettingStack.get(1).title)
+ 
+     bottomPadding: 0
+     leftPadding: 0
+@@ -42,9 +44,8 @@ PageRow {
+             pageSettingStack.pop();
+         }
+     }
+-
+-    PagePool {
+-        id: pageSettingsPool
++    onWidthChanged: if (pageSettingStack.depth < 2 && pageSettingStack.width >= Units.gridUnit * 40) {
++        actions[0].trigger();
+     }
+ 
+     initialPage: ScrollablePage {
+@@ -58,6 +59,8 @@ PageRow {
+             id: listview
+             Component.onCompleted: if (pageSettingStack.width >= Units.gridUnit * 40) {
+                 actions[0].trigger();
++            } else {
++                listview.currentIndex = -1;
+             }
+             model: pageSettingStack.actions
+             delegate: pageSettingStack.wideMode ? desktopStyle : mobileStyle
+@@ -69,7 +72,6 @@ PageRow {
+ 
+         QQC2.ItemDelegate {
+             width: parent && parent.width > 0 ? parent.width : implicitWidth
+-            height: visible ? implicitHeight : 0
+             implicitWidth: contentItem.implicitWidth + Units.smallSpacing * 4
+             implicitHeight: contentItem.implicitHeight + Units.smallSpacing * 2
+             highlighted: ListView.isCurrentItem
+@@ -105,6 +107,9 @@ PageRow {
+ 
+         BasicListItem {
+             action: modelData
++            onClicked: {
++                listview.currentIndex = index;
++            }
+         }
+     }
+ }


More information about the Neon-commits mailing list