From b1305646f8f77c19242b8241e29b09b9312aa8ca Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 4 Aug 2015 15:20:03 +0200 Subject: Fixed overlay display animation timeout The animation is now restarted on every height and width change event. In practice this leads to the overlay being displayed continuously during multiline resize operations but only briefly on single line resize operations. --- qml/EmbeddedTerminal.qml | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'qml') diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml index 70b7cf1..382a781 100644 --- a/qml/EmbeddedTerminal.qml +++ b/qml/EmbeddedTerminal.qml @@ -76,18 +76,30 @@ Item { onTermGetFocus: highlighter.focus() onTermLostFocus: highlighter.unfocus() onHeightChanged: overlay.displayBriefly(); + onWidthChanged: overlay.displayBriefly(); Rectangle { id: overlay function displayBriefly() { - animation.running = true; + animation.restart(); } anchors.fill: parent opacity: 0 color: "black" + NumberAnimation { + id: animation + target: overlay + property: "opacity" + + easing.type: Easing.InSine + duration: 500 + from: 0.8 + to: 0 + } + Text { anchors { horizontalCenter: overlay.horizontalCenter @@ -106,30 +118,6 @@ Item { } color: "white" } - - SequentialAnimation { - id: animation - - NumberAnimation { - target: overlay - property: "opacity" - - easing.type: Easing.InSine - duration: 500 - from: 0 - to: 0.8 - } - - NumberAnimation { - target: overlay - property: "opacity" - - easing.type: Easing.InSine - duration: 500 - from: 0.8 - to: 0 - } - } } MouseArea { -- cgit v1.2.3