mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
try to interact only with the applet in the top area
has to be tested, maybe is even worse, but in order to not interfere with the vertical scrollbar of things like networkmanager needs a real solution
This commit is contained in:
parent
6158b232b6
commit
c0ef6c6747
1 changed files with 14 additions and 0 deletions
|
|
@ -62,9 +62,14 @@ FullScreenPanel {
|
|||
|
||||
property int oldMouseY: 0
|
||||
property int startOffset: units.iconSizes.large;
|
||||
property int startMouseY: 0
|
||||
property string startState: "closed"
|
||||
|
||||
onPressed: {
|
||||
startMouseY = mouse.y;
|
||||
if (startMouseY < contentArea.height - units.iconSizes.large) {
|
||||
return;
|
||||
}
|
||||
startState = state;
|
||||
startOffset = window.offset;
|
||||
oldMouseY = mouse.y;
|
||||
|
|
@ -72,12 +77,18 @@ FullScreenPanel {
|
|||
window.offset = startOffset;
|
||||
}
|
||||
onPositionChanged: {
|
||||
if (startMouseY < contentArea.height - units.iconSizes.large) {
|
||||
return;
|
||||
}
|
||||
var factor = (mouse.y - oldMouseY > 0) ? (1 - Math.max(0, (slidingArea.y + overShoot) / overShoot)) : 1
|
||||
|
||||
window.offset = window.offset + (mouse.y - oldMouseY) * factor;
|
||||
oldMouseY = mouse.y;
|
||||
}
|
||||
onReleased: {
|
||||
if (startMouseY < contentArea.height - units.iconSizes.large) {
|
||||
return;
|
||||
}
|
||||
if (Math.abs(window.offset - mouseArea.startOffset) < units.gridUnit &&
|
||||
slidingArea.y + slidingArea.height < mouse.y) {
|
||||
mouseArea.state = "closed";
|
||||
|
|
@ -137,6 +148,9 @@ FullScreenPanel {
|
|||
z: -1
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
if (startMouseY < contentArea.height - units.iconSizes.large) {
|
||||
return;
|
||||
}
|
||||
mouseArea.state = "closed";
|
||||
//window.visible = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue