better open behavior

This commit is contained in:
Marco Martin 2017-09-01 18:49:07 +02:00
parent c82c24a974
commit 48c8071bdb

View file

@ -39,7 +39,7 @@ FullScreenPanel {
property alias fixedArea: fixedArea property alias fixedArea: fixedArea
function open() { function open() {
window.visible = true; window.visible = true;
openAnim.running = true; peekAnim.running = true;
} }
function close() { function close() {
closeAnim.running = true; closeAnim.running = true;
@ -49,6 +49,8 @@ FullScreenPanel {
close(); close();
} else if (offset < peekHeight) { } else if (offset < peekHeight) {
open(); open();
} else if (mainFlickable.contentY < 0) {
openAnim.running = true;
} }
} }
@ -75,7 +77,7 @@ FullScreenPanel {
} }
} }
PropertyAnimation { PropertyAnimation {
id: openAnim id: peekAnim
target: window target: window
duration: units.longDuration duration: units.longDuration
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
@ -83,6 +85,15 @@ FullScreenPanel {
from: window.offset from: window.offset
to: window.peekHeight to: window.peekHeight
} }
PropertyAnimation {
id: openAnim
target: window
duration: units.longDuration
easing.type: Easing.InOutQuad
properties: "offset"
from: window.offset
to: contentArea.height
}
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@ -90,7 +101,6 @@ FullScreenPanel {
} }
PlasmaCore.ColorScope { PlasmaCore.ColorScope {
id: slidingArea
anchors.fill: parent anchors.fill: parent
y: Math.min(0, -height + window.offset) y: Math.min(0, -height + window.offset)
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup colorGroup: PlasmaCore.Theme.ComplementaryColorGroup