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:
Marco Martin 2015-07-13 15:50:22 +02:00
parent 6158b232b6
commit c0ef6c6747

View file

@ -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;
}