From 0c631b092b3447d71b4f6f7c98930360b41a98d9 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 4 Aug 2015 08:14:14 +0200 Subject: Implemented basic terminal size overlay Needs further fiddling concerning the animation curve and display duration --- qml/EmbeddedTerminal.qml | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'qml') diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml index 7e021b3..70b7cf1 100644 --- a/qml/EmbeddedTerminal.qml +++ b/qml/EmbeddedTerminal.qml @@ -75,6 +75,62 @@ Item { onTermGetFocus: highlighter.focus() onTermLostFocus: highlighter.unfocus() + onHeightChanged: overlay.displayBriefly(); + + Rectangle { + id: overlay + + function displayBriefly() { + animation.running = true; + } + + anchors.fill: parent + opacity: 0 + color: "black" + + Text { + anchors { + horizontalCenter: overlay.horizontalCenter + verticalCenter: overlay.verticalCenter + } + + text: { + return item.lines + + 'x' + + Math.floor(terminal.width / terminal.fontMetrics.width); + } + + font { + family: settings.fontFamily + pointSize: 16 + } + 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 { anchors.fill: parent -- cgit v1.2.3