mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 14:33:08 +00:00
actiondrawer: add ability to open and expand quicksettings with one stroke
This commit is contained in:
parent
2c61bb1723
commit
fb8494fec4
2 changed files with 13 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ MouseArea {
|
|||
anchors.fill: parent
|
||||
onPressed: {
|
||||
oldMouseY = mouse.y;
|
||||
|
||||
actionDrawer.expandable = mouse.x < root.width/2 ? true : false;
|
||||
|
||||
startSwipe();
|
||||
}
|
||||
onReleased: endSwipe()
|
||||
|
|
|
|||
Loading…
Reference in a new issue