From fb8494fec4e3abbfe0ba2baf7995b9b1024245a0 Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Wed, 25 May 2022 03:03:21 +0200 Subject: [PATCH 1/2] actiondrawer: add ability to open and expand quicksettings with one stroke --- .../mobileshell/qml/actiondrawer/ActionDrawer.qml | 10 ++++++++++ .../qml/actiondrawer/ActionDrawerOpenSurface.qml | 3 +++ 2 files changed, 13 insertions(+) diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml index 97adb547..374b2142 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml @@ -55,6 +55,11 @@ Item { */ property bool opened: false + /** + * Whether the panel can be opened with one stroke. + */ + property bool expandable: false + /** * Direction the panel is currently moving in. */ @@ -108,6 +113,11 @@ Item { if (offset < 0) { offset = 0; } + + if (offset >= contentContainerLoader.minimizedQuickSettingsOffset && expandable) { + root.opened = true; + } + root.direction = (oldOffset === offset) ? MobileShell.Direction.None : (offset > oldOffset ? MobileShell.Direction.Down : MobileShell.Direction.Up); diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml index 84487070..059e0076 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml @@ -43,6 +43,9 @@ MouseArea { anchors.fill: parent onPressed: { oldMouseY = mouse.y; + + actionDrawer.expandable = mouse.x < root.width/2 ? true : false; + startSwipe(); } onReleased: endSwipe() From aa4ddf8afdba9207899b09f4336e28899f9e1027 Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Wed, 25 May 2022 18:13:29 +0200 Subject: [PATCH 2/2] change property name --- components/mobileshell/qml/actiondrawer/ActionDrawer.qml | 7 ++++--- .../qml/actiondrawer/ActionDrawerOpenSurface.qml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml index 374b2142..675806d7 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml @@ -56,9 +56,10 @@ Item { property bool opened: false /** - * Whether the panel can be opened with one stroke. + * Whether the panel should open to pinned mode first, with a second stroke needed to full open. + * Only applies to portrait mode. */ - property bool expandable: false + property bool openToPinnedMode: true /** * Direction the panel is currently moving in. @@ -114,7 +115,7 @@ Item { offset = 0; } - if (offset >= contentContainerLoader.minimizedQuickSettingsOffset && expandable) { + if (offset >= contentContainerLoader.minimizedQuickSettingsOffset && !openToPinnedMode) { root.opened = true; } diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml index 059e0076..3e84ea1a 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml @@ -44,7 +44,7 @@ MouseArea { onPressed: { oldMouseY = mouse.y; - actionDrawer.expandable = mouse.x < root.width/2 ? true : false; + actionDrawer.openToPinnedMode = mouse.x < root.width/2 ? false : true; startSwipe(); }