From 06c6d7a74d5fcec490cd124a06d9326dc5792ea9 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 12 Jul 2018 16:16:12 +0800 Subject: [PATCH] Add animation for sending. --- qml/form/RoomForm.qml | 47 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/qml/form/RoomForm.qml b/qml/form/RoomForm.qml index 100c6e7..c1f24ed 100644 --- a/qml/form/RoomForm.qml +++ b/qml/form/RoomForm.qml @@ -108,24 +108,6 @@ Item { ScrollBar.vertical: ScrollBar {} - Behavior on contentY { - PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 } - } - -// Popup { -// id: loadingPopup - -// x: item.x + (item.width - width) / 2 -// y: 90 - -// modal: true -// focus: true - -// closePolicy: Popup.CloseOnEscape - -// BusyIndicator { running: true } -// } - RoundButton { id: goTopFab width: height @@ -177,7 +159,7 @@ Item { folder: shortcuts.home onAccepted: { console.log("You chose: " + fileDialog.fileUrls) - matriqueController.uploadFile(fileDialog.fileUrls) + currentRoom.uploadFile(fileDialog.fileUrls) } } } @@ -192,12 +174,35 @@ Item { bottomPadding: 0 selectByMouse: true - background: Rectangle { - color: Material.theme == Material.Light ? "#eaeaea" : "#242424" + background: Item{ + Rectangle { + anchors.fill: parent + color: Material.theme == Material.Light ? "#eaeaea" : "#242424" + } + + Rectangle { + id:progressIndicator + + height: parent.height + width: 0 + color: Material.accent + opacity: 1 - width / inputField.width + + NumberAnimation on width { + id: animation + from: 0 + to: inputField.width + duration: 300 + easing.type: Easing.Linear + } + + function animate() { animation.start() } + } } Keys.onReturnPressed: { postMessage(inputField.text) + progressIndicator.animate() inputField.text = "" }