mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 10:44:46 +00:00
never close the panel when dragging
This commit is contained in:
parent
f6b68d853c
commit
49cd27ec5f
2 changed files with 19 additions and 4 deletions
|
|
@ -29,6 +29,7 @@ FullScreenPanel {
|
||||||
|
|
||||||
property int offset: 0
|
property int offset: 0
|
||||||
property int peekHeight
|
property int peekHeight
|
||||||
|
property bool userInteracting: false
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
property alias contents: contentArea.data
|
property alias contents: contentArea.data
|
||||||
|
|
@ -140,8 +141,16 @@ FullScreenPanel {
|
||||||
contentWidth: window.width
|
contentWidth: window.width
|
||||||
contentHeight: window.height*2
|
contentHeight: window.height*2
|
||||||
bottomMargin: window.height
|
bottomMargin: window.height
|
||||||
onMovementEnded: window.updateState();
|
onMovementStarted: window.userInteracting = true;
|
||||||
onFlickEnded: window.updateState();
|
onFlickStarted: window.userInteracting = true;
|
||||||
|
onMovementEnded: {
|
||||||
|
window.userInteracting = false;
|
||||||
|
window.updateState();
|
||||||
|
}
|
||||||
|
onFlickEnded: {
|
||||||
|
window.userInteracting = true;
|
||||||
|
window.updateState();
|
||||||
|
}
|
||||||
Item {
|
Item {
|
||||||
width: window.width
|
width: window.width
|
||||||
height: Math.max(contentArea.height, window.height*2)
|
height: Math.max(contentArea.height, window.height*2)
|
||||||
|
|
@ -153,7 +162,9 @@ FullScreenPanel {
|
||||||
}
|
}
|
||||||
height: children[0].implicitHeight
|
height: children[0].implicitHeight
|
||||||
onHeightChanged: {
|
onHeightChanged: {
|
||||||
updateStateTimer.restart()
|
if (!window.userInteracting) {
|
||||||
|
updateStateTimer.restart()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,7 @@ PlasmaCore.ColorScope {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onPressed: {
|
onPressed: {
|
||||||
|
slidingPanel.userInteracting = true;
|
||||||
oldMouseY = mouse.y;
|
oldMouseY = mouse.y;
|
||||||
slidingPanel.visible = true;
|
slidingPanel.visible = true;
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +194,10 @@ PlasmaCore.ColorScope {
|
||||||
slidingPanel.offset = slidingPanel.offset + (mouse.y - oldMouseY) * factor;
|
slidingPanel.offset = slidingPanel.offset + (mouse.y - oldMouseY) * factor;
|
||||||
oldMouseY = mouse.y;
|
oldMouseY = mouse.y;
|
||||||
}
|
}
|
||||||
onReleased: slidingPanel.updateState();
|
onReleased: {
|
||||||
|
slidingPanel.userInteracting = false;
|
||||||
|
slidingPanel.updateState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SlidingPanel {
|
SlidingPanel {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue