Merge branch 'skilvingr/plasma-mobile-actiondrawer-opening' into origin/master

This commit is contained in:
Devin Lin 2022-05-25 12:19:48 -04:00
commit be159dadc1
2 changed files with 14 additions and 0 deletions

View file

@ -55,6 +55,12 @@ Item {
*/
property bool opened: false
/**
* Whether the panel should open to pinned mode first, with a second stroke needed to full open.
* Only applies to portrait mode.
*/
property bool openToPinnedMode: true
/**
* Direction the panel is currently moving in.
*/
@ -108,6 +114,11 @@ Item {
if (offset < 0) {
offset = 0;
}
if (offset >= contentContainerLoader.minimizedQuickSettingsOffset && !openToPinnedMode) {
root.opened = true;
}
root.direction = (oldOffset === offset)
? MobileShell.Direction.None
: (offset > oldOffset ? MobileShell.Direction.Down : MobileShell.Direction.Up);

View file

@ -43,6 +43,9 @@ MouseArea {
anchors.fill: parent
onPressed: {
oldMouseY = mouse.y;
actionDrawer.openToPinnedMode = mouse.x < root.width/2 ? false : true;
startSwipe();
}
onReleased: endSwipe()