Remove quantity

This commit is contained in:
Zach Fox 2017-08-28 09:58:45 -07:00
parent 52cb1dd893
commit 67f3b5c027

View file

@ -431,108 +431,11 @@ Rectangle {
} }
} }
// Item Price text // "Item Price" container
Item { Item {
id: itemPriceContainer; id: itemPriceContainer;
// Anchors // Anchors
anchors.top: itemAuthorContainer.bottom; anchors.top: itemAuthorContainer.bottom;
anchors.topMargin: 4;
anchors.left: parent.left;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: childrenRect.height;
RalewaySemiBold {
id: itemPriceTextLabel;
text: "Price:";
// Anchors
anchors.top: parent.top;
anchors.left: parent.left;
width: paintedWidth;
height: paintedHeight;
// Text size
size: 20;
// Style
color: hifi.colors.lightGrayText;
// Alignment
horizontalAlignment: Text.AlignLeft;
verticalAlignment: Text.AlignVCenter;
}
RalewayRegular {
id: itemPriceText;
text: "-- HFC";
// Text size
size: itemPriceTextLabel.size;
// Anchors
anchors.top: parent.top;
anchors.left: itemPriceTextLabel.right;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: paintedHeight;
// Style
color: hifi.colors.lightGrayText;
// Alignment
horizontalAlignment: Text.AlignRight;
verticalAlignment: Text.AlignVCenter;
}
}
// "Quantity" container
Item {
id: quantityContainer;
// Anchors
anchors.top: itemPriceContainer.bottom;
anchors.topMargin: 4;
anchors.left: parent.left;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: childrenRect.height;
RalewaySemiBold {
id: quantityTextLabel;
text: "Quantity:";
// Anchors
anchors.top: parent.top;
anchors.left: parent.left;
width: paintedWidth;
height: paintedHeight;
// Text size
size: 20;
// Style
color: hifi.colors.lightGrayText;
// Alignment
horizontalAlignment: Text.AlignLeft;
verticalAlignment: Text.AlignVCenter;
}
// ZRF FIXME: MAKE DROPDOWN???
RalewayRegular {
id: quantityText;
text: "1";
// Text size
size: quantityTextLabel.size;
// Anchors
anchors.top: parent.top;
anchors.left: quantityTextLabel.right;
anchors.leftMargin: 16;
anchors.right: parent.right;
anchors.rightMargin: 16;
height: paintedHeight;
// Style
color: hifi.colors.lightGrayText;
// Alignment
horizontalAlignment: Text.AlignRight;
verticalAlignment: Text.AlignVCenter;
}
}
// "Total Cost" container
Item {
id: totalCostContainer;
// Anchors
anchors.top: quantityContainer.bottom;
anchors.topMargin: 32; anchors.topMargin: 32;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 16; anchors.leftMargin: 16;
@ -541,8 +444,8 @@ Rectangle {
height: childrenRect.height; height: childrenRect.height;
RalewaySemiBold { RalewaySemiBold {
id: totalCostTextLabel; id: itemPriceTextLabel;
text: "<b>Total Cost:</b>"; text: "<b>Item Price:</b>";
// Anchors // Anchors
anchors.top: parent.top; anchors.top: parent.top;
anchors.left: parent.left; anchors.left: parent.left;
@ -557,13 +460,13 @@ Rectangle {
verticalAlignment: Text.AlignVCenter; verticalAlignment: Text.AlignVCenter;
} }
RalewayRegular { RalewayRegular {
id: totalCostText; id: itemPriceText;
text: "<b>-- HFC</b>"; text: "<b>-- HFC</b>";
// Text size // Text size
size: totalCostTextLabel.size; size: itemPriceTextLabel.size;
// Anchors // Anchors
anchors.top: parent.top; anchors.top: parent.top;
anchors.left: totalCostTextLabel.right; anchors.left: itemPriceTextLabel.right;
anchors.leftMargin: 16; anchors.leftMargin: 16;
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: 16; anchors.rightMargin: 16;
@ -580,7 +483,7 @@ Rectangle {
Item { Item {
id: balanceAfterPurchaseContainer; id: balanceAfterPurchaseContainer;
// Anchors // Anchors
anchors.top: totalCostContainer.bottom; anchors.top: itemPriceContainer.bottom;
anchors.topMargin: 16; anchors.topMargin: 16;
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: 16; anchors.leftMargin: 16;
@ -611,7 +514,7 @@ Rectangle {
size: balanceAfterPurchaseTextLabel.size; size: balanceAfterPurchaseTextLabel.size;
// Anchors // Anchors
anchors.top: parent.top; anchors.top: parent.top;
anchors.left: totalCostTextLabel.right; anchors.left: balanceAfterPurchaseTextLabel.right;
anchors.leftMargin: 16; anchors.leftMargin: 16;
anchors.right: parent.right; anchors.right: parent.right;
anchors.rightMargin: 16; anchors.rightMargin: 16;
@ -945,8 +848,7 @@ Rectangle {
itemNameText.text = message.params.itemName; itemNameText.text = message.params.itemName;
itemAuthorText.text = message.params.itemAuthor; itemAuthorText.text = message.params.itemAuthor;
root.itemPriceFull = message.params.itemPrice; root.itemPriceFull = message.params.itemPrice;
itemPriceText.text = (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC"; itemPriceText.text = root.itemPriceFull === 0 ? "Free" : "<b>" + (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC</b>";
totalCostText.text = root.itemPriceFull === 0 ? "Free" : "<b>" + (parseFloat(root.itemPriceFull/100).toFixed(2)) + " HFC</b>";
itemHref = message.params.itemHref; itemHref = message.params.itemHref;
if (itemHref.indexOf('.json') === -1) { if (itemHref.indexOf('.json') === -1) {
root.itemIsJson = false; root.itemIsJson = false;