MS14295: Fix lingering Gifts UI Bugs

This commit is contained in:
Zach Fox 2018-04-26 15:57:37 -07:00
parent 2be40d487e
commit e3b14bf478

View file

@ -258,7 +258,9 @@ Item {
anchors.topMargin: 26; anchors.topMargin: 26;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 20; anchors.leftMargin: 20;
width: paintedWidth; anchors.right: parent.right;
anchors.rightMargin: 20;
elide: Text.ElideRight;
height: 30; height: 30;
// Text size // Text size
size: 22; size: 22;
@ -844,7 +846,7 @@ Item {
property string selectedRecipientUserName; property string selectedRecipientUserName;
property string selectedRecipientProfilePic; property string selectedRecipientProfilePic;
visible: root.currentActiveView === "sendAssetStep"; visible: root.currentActiveView === "sendAssetStep" || paymentSuccess.visible || paymentFailure.visible;
anchors.fill: parent; anchors.fill: parent;
anchors.topMargin: root.parentAppTitleBarHeight; anchors.topMargin: root.parentAppTitleBarHeight;
@ -856,7 +858,9 @@ Item {
anchors.topMargin: 26; anchors.topMargin: 26;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 20; anchors.leftMargin: 20;
width: paintedWidth; anchors.right: parent.right;
anchors.rightMargin: 20;
elide: Text.ElideRight;
height: 30; height: 30;
// Text size // Text size
size: 22; size: 22;
@ -907,7 +911,7 @@ Item {
// "CHANGE" button // "CHANGE" button
HifiControlsUit.Button { HifiControlsUit.Button {
id: changeButton; id: changeButton;
color: root.assetName === "" ? hifi.buttons.none : hifi.buttons.noneBorderlessGray; color: root.assetName === "" ? hifi.buttons.none : hifi.buttons.white;
colorScheme: hifi.colorSchemes.dark; colorScheme: hifi.colorSchemes.dark;
anchors.right: parent.right; anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
@ -1238,7 +1242,7 @@ Item {
// Sending Asset Overlay START // Sending Asset Overlay START
Rectangle { Rectangle {
id: sendingAssetOverlay; id: sendingAssetOverlay;
z: 998; z: 999;
visible: root.isCurrentlySendingAsset; visible: root.isCurrentlySendingAsset;
anchors.fill: parent; anchors.fill: parent;
@ -1281,26 +1285,43 @@ Item {
// Payment Success BEGIN // Payment Success BEGIN
Rectangle { Rectangle {
id: paymentSuccess; id: paymentSuccess;
z: 998;
visible: root.currentActiveView === "paymentSuccess"; visible: root.currentActiveView === "paymentSuccess";
anchors.fill: parent; anchors.fill: parent;
color: Qt.rgba(0.0, 0.0, 0.0, 0.8); color: Qt.rgba(0.0, 0.0, 0.0, 0.8);
// This object is always used in a popup or full-screen Wallet section.
// This MouseArea is used to prevent a user from being
// able to click on a button/mouseArea underneath the popup/section.
MouseArea {
anchors.fill: parent;
propagateComposedEvents: false;
hoverEnabled: true;
}
Rectangle { Rectangle {
anchors.centerIn: parent; anchors.top: parent.top;
width: parent.width - 30; anchors.topMargin: root.assetName === "" ? 15 : 150;
height: parent.height - 30; anchors.left: parent.left;
anchors.leftMargin: root.assetName === "" ? 15 : 50;
anchors.right: parent.right;
anchors.rightMargin: root.assetName === "" ? 15 : 50;
anchors.bottom: parent.bottom;
anchors.bottomMargin: root.assetName === "" ? 15 : 300;
color: "#FFFFFF"; color: "#FFFFFF";
RalewaySemiBold { RalewaySemiBold {
id: paymentSentText; id: paymentSentText;
text: root.assetName === "" ? "Payment Sent" : '"' + root.assetName + '"'; text: root.assetName === "" ? "Payment Sent" : "Gift Sent";
// Anchors // Anchors
anchors.top: parent.top; anchors.top: parent.top;
anchors.topMargin: 26; anchors.topMargin: 26;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 20; anchors.leftMargin: 20;
width: paintedWidth; anchors.right: parent.right;
anchors.rightMargin: 20;
elide: Text.ElideRight;
height: 30; height: 30;
// Text size // Text size
size: 22; size: 22;
@ -1310,6 +1331,7 @@ Item {
HiFiGlyphs { HiFiGlyphs {
id: closeGlyphButton_paymentSuccess; id: closeGlyphButton_paymentSuccess;
visible: root.assetName === "";
text: hifi.glyphs.close; text: hifi.glyphs.close;
color: hifi.colors.lightGrayText; color: hifi.colors.lightGrayText;
size: 26; size: 26;
@ -1375,6 +1397,48 @@ Item {
isDisplayingNearby: sendAssetStep.referrer === "nearby"; isDisplayingNearby: sendAssetStep.referrer === "nearby";
} }
} }
Item {
id: giftContainer_paymentSuccess;
visible: root.assetName !== "";
anchors.top: sendToContainer_paymentSuccess.bottom;
anchors.topMargin: 16;
anchors.left: parent.left;
anchors.leftMargin: 20;
anchors.right: parent.right;
anchors.rightMargin: 20;
height: 80;
RalewaySemiBold {
id: gift_paymentSuccess;
text: "Gift:";
// Anchors
anchors.top: parent.top;
anchors.left: parent.left;
anchors.bottom: parent.bottom;
width: 90;
// Text size
size: 18;
// Style
color: hifi.colors.baseGray;
verticalAlignment: Text.AlignVCenter;
}
RalewaySemiBold {
text: root.assetName;
// Anchors
anchors.top: parent.top;
anchors.left: gift_paymentSuccess.right;
anchors.right: parent.right;
// Text size
size: 18;
// Style
elide: Text.ElideRight;
color: hifi.colors.baseGray;
verticalAlignment: Text.AlignVCenter;
}
}
Item { Item {
id: amountContainer_paymentSuccess; id: amountContainer_paymentSuccess;
@ -1433,6 +1497,7 @@ Item {
RalewaySemiBold { RalewaySemiBold {
id: optionalMessage_paymentSuccess; id: optionalMessage_paymentSuccess;
visible: root.assetName === "";
text: optionalMessage.text; text: optionalMessage.text;
// Anchors // Anchors
anchors.top: amountContainer_paymentSuccess.visible ? amountContainer_paymentSuccess.bottom : sendToContainer_paymentSuccess.bottom; anchors.top: amountContainer_paymentSuccess.visible ? amountContainer_paymentSuccess.bottom : sendToContainer_paymentSuccess.bottom;
@ -1476,26 +1541,43 @@ Item {
// Payment Failure BEGIN // Payment Failure BEGIN
Rectangle { Rectangle {
id: paymentFailure; id: paymentFailure;
z: 998;
visible: root.currentActiveView === "paymentFailure"; visible: root.currentActiveView === "paymentFailure";
anchors.fill: parent; anchors.fill: parent;
color: Qt.rgba(0.0, 0.0, 0.0, 0.8); color: Qt.rgba(0.0, 0.0, 0.0, 0.8);
// This object is always used in a popup or full-screen Wallet section.
// This MouseArea is used to prevent a user from being
// able to click on a button/mouseArea underneath the popup/section.
MouseArea {
anchors.fill: parent;
propagateComposedEvents: false;
hoverEnabled: true;
}
Rectangle { Rectangle {
anchors.centerIn: parent; anchors.top: parent.top;
width: parent.width - 30; anchors.topMargin: root.assetName === "" ? 15 : 150;
height: parent.height - 30; anchors.left: parent.left;
anchors.leftMargin: root.assetName === "" ? 15 : 50;
anchors.right: parent.right;
anchors.rightMargin: root.assetName === "" ? 15 : 50;
anchors.bottom: parent.bottom;
anchors.bottomMargin: root.assetName === "" ? 15 : 300;
color: "#FFFFFF"; color: "#FFFFFF";
RalewaySemiBold { RalewaySemiBold {
id: paymentFailureText; id: paymentFailureText;
text: root.assetName === "" ? "Payment Failed" : '"' + root.assetName + '"'; text: root.assetName === "" ? "Payment Failed" : "Failed";
// Anchors // Anchors
anchors.top: parent.top; anchors.top: parent.top;
anchors.topMargin: 26; anchors.topMargin: 26;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 20; anchors.leftMargin: 20;
width: paintedWidth; anchors.right: parent.right;
anchors.rightMargin: 20;
elide: Text.ElideRight;
height: 30; height: 30;
// Text size // Text size
size: 22; size: 22;
@ -1505,6 +1587,7 @@ Item {
HiFiGlyphs { HiFiGlyphs {
id: closeGlyphButton_paymentFailure; id: closeGlyphButton_paymentFailure;
visible: root.assetName === "";
text: hifi.glyphs.close; text: hifi.glyphs.close;
color: hifi.colors.lightGrayText; color: hifi.colors.lightGrayText;
size: 26; size: 26;
@ -1551,6 +1634,7 @@ Item {
Item { Item {
id: sendToContainer_paymentFailure; id: sendToContainer_paymentFailure;
visible: root.assetName === "";
anchors.top: paymentFailureDetailText.bottom; anchors.top: paymentFailureDetailText.bottom;
anchors.topMargin: 8; anchors.topMargin: 8;
anchors.left: parent.left; anchors.left: parent.left;
@ -1645,7 +1729,8 @@ Item {
} }
RalewaySemiBold { RalewaySemiBold {
id: optionalMessage_paymentFailuire; id: optionalMessage_paymentFailure;
visible: root.assetName === "";
text: optionalMessage.text; text: optionalMessage.text;
// Anchors // Anchors
anchors.top: amountContainer_paymentFailure.visible ? amountContainer_paymentFailure.bottom : sendToContainer_paymentFailure.bottom; anchors.top: amountContainer_paymentFailure.visible ? amountContainer_paymentFailure.bottom : sendToContainer_paymentFailure.bottom;
@ -1663,14 +1748,15 @@ Item {
verticalAlignment: Text.AlignTop; verticalAlignment: Text.AlignTop;
} }
// "Close" button // "Cancel" button
HifiControlsUit.Button { HifiControlsUit.Button {
id: closeButton_paymentFailure; id: closeButton_paymentFailure;
color: hifi.buttons.noneBorderless; color: hifi.buttons.noneBorderless;
colorScheme: root.assetName === "" ? hifi.colorSchemes.dark : hifi.colorSchemes.light; colorScheme: root.assetName === "" ? hifi.colorSchemes.dark : hifi.colorSchemes.light;
anchors.horizontalCenter: parent.horizontalCenter; anchors.right: retryButton_paymentFailure.left;
anchors.rightMargin: 12;
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
anchors.bottomMargin: 80; anchors.bottomMargin: root.assetName === "" ? 80 : 30;
height: 50; height: 50;
width: 120; width: 120;
text: "Cancel"; text: "Cancel";
@ -1691,7 +1777,7 @@ Item {
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: 12; anchors.rightMargin: 12;
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom;
anchors.bottomMargin: 80; anchors.bottomMargin: root.assetName === "" ? 80 : 30;
height: 50; height: 50;
width: 120; width: 120;
text: "Retry"; text: "Retry";