From 83a60a541b14723e542da8544607db5f5744121e Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 27 Dec 2018 18:53:07 -0800 Subject: [PATCH] Fix styling and flow issues in avatar uploader --- .../resources/qml/hifi/AvatarPackager.qml | 2 + .../qml/hifi/avatarPackager/AvatarProject.qml | 2 +- .../avatarPackager/AvatarProjectUpload.qml | 46 ++++++++++++++++--- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/interface/resources/qml/hifi/AvatarPackager.qml b/interface/resources/qml/hifi/AvatarPackager.qml index ff275923ac..1300184591 100644 --- a/interface/resources/qml/hifi/AvatarPackager.qml +++ b/interface/resources/qml/hifi/AvatarPackager.qml @@ -45,6 +45,8 @@ Windows.ScrollingWindow { anchors.leftMargin: 29 anchors.rightMargin: 29 + clip: true + ListView { anchors.fill: parent model: AvatarPackagerCore.currentAvatarProject === null ? [] : AvatarPackagerCore.currentAvatarProject.projectFiles diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml index 96daf2c0ca..c94c9570ae 100644 --- a/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml +++ b/interface/resources/qml/hifi/avatarPackager/AvatarProject.qml @@ -229,7 +229,7 @@ Item { name: "upload-success" PropertyChanges { target: infoMessage - text: "Your avatar has been uploaded to our servers. You can modify the project files and update it again to make changes on the uploaded avatar." + text: "Your avatar has been successfully uploaded to our servers. Make changes to your avatar by editing and uploading the project files." } }, State { diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarProjectUpload.qml b/interface/resources/qml/hifi/avatarPackager/AvatarProjectUpload.qml index f02dc5a218..b21bd38070 100644 --- a/interface/resources/qml/hifi/avatarPackager/AvatarProjectUpload.qml +++ b/interface/resources/qml/hifi/avatarPackager/AvatarProjectUpload.qml @@ -17,7 +17,7 @@ Item { Timer { id: backToProjectTimer - interval: 5000 + interval: 2000 running: false repeat: false onTriggered: { @@ -37,7 +37,9 @@ Item { if (visible) { root.uploader.stateChanged.connect(stateChangedCallback); root.uploader.finishedChanged.connect(function() { - backToProjectTimer.start(); + if (root.uploader.error === 0) { + backToProjectTimer.start(); + } }); } } @@ -53,7 +55,7 @@ Item { id: statusItem width: parent.width - height: 192 + height: 256 states: [ State { @@ -69,6 +71,8 @@ Item { PropertyChanges { target: uploadSpinner; visible: false } PropertyChanges { target: errorIcon; visible: true } PropertyChanges { target: successIcon; visible: false } + PropertyChanges { target: errorFooter; visible: true } + PropertyChanges { target: errorMessage; visible: true } } ] @@ -99,7 +103,7 @@ Item { verticalCenter: parent.verticalCenter } - size: 164 + size: 315 text: "+" color: "#EA4C5F" } @@ -151,20 +155,48 @@ Item { } RalewayRegular { - visible: root.uploader.error + id: errorMessage + + visible: false anchors.left: parent.left anchors.right: parent.right - anchors.bottom: parent.bottom + anchors.bottom: errorFooter.top anchors.leftMargin: 16 anchors.rightMargin: 16 - anchors.bottomMargin: 16 + anchors.bottomMargin: 32 size: 28 wrapMode: Text.Wrap color: "white" text: "We couldn't upload your avatar at this time. Please try again later." } + AvatarPackagerFooter { + id: errorFooter + + anchors.bottom: parent.bottom + visible: false + + content: Item { + anchors.fill: parent + anchors.rightMargin: 17 + HifiControls.Button { + id: backButton + + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + + text: qsTr("Back") + color: hifi.buttons.blue + colorScheme: root.colorScheme + width: 133 + height: 40 + onClicked: function() { + avatarPackager.state = "project" + } + } + } + } } Column {