Merge pull request #15179 from roxanneskelly/Case21703

Case 21703, Case 21704, Case 21701 - random marketplace UI fixes
This commit is contained in:
Shannon Romano 2019-03-13 16:45:46 -07:00 committed by GitHub
commit 58146063db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 1 deletions

View file

@ -143,6 +143,16 @@ Original.Button {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: control.text text: control.text
Component.onCompleted: { Component.onCompleted: {
setTextPosition();
}
onTextChanged: {
setTextPosition();
}
function setTextPosition() {
// force TextMetrics to re-evaluate the text field and glyph sizes
// as for some reason it's not automatically being done.
buttonGlyphTextMetrics.text = buttonGlyph.text;
buttonTextMetrics.text = text;
if (control.buttonGlyph !== "") { if (control.buttonGlyph !== "") {
buttonText.x = buttonContentItem.width/2 - buttonTextMetrics.width/2 + (buttonGlyphTextMetrics.width + control.buttonGlyphRightMargin)/2; buttonText.x = buttonContentItem.width/2 - buttonTextMetrics.width/2 + (buttonGlyphTextMetrics.width + control.buttonGlyphRightMargin)/2;
} else { } else {

View file

@ -71,6 +71,7 @@ Item {
onBalanceResult : { onBalanceResult : {
balanceText.text = result.data.balance; balanceText.text = result.data.balance;
sendButton.enabled = true;
} }
onTransferAssetToNodeResult: { onTransferAssetToNodeResult: {
@ -1371,6 +1372,7 @@ Item {
height: 40; height: 40;
width: 100; width: 100;
text: "SUBMIT"; text: "SUBMIT";
enabled: false;
onClicked: { onClicked: {
if (root.assetCertID === "" && parseInt(amountTextField.text) > parseInt(balanceText.text)) { if (root.assetCertID === "" && parseInt(amountTextField.text) > parseInt(balanceText.text)) {
amountTextField.focus = true; amountTextField.focus = true;

View file

@ -569,6 +569,8 @@ Rectangle {
standaloneOptimized: model.standalone_optimized standaloneOptimized: model.standalone_optimized
onShowItem: { onShowItem: {
// reset the edition back to -1 to clear the 'update item' status
marketplaceItem.edition = -1;
MarketplaceScriptingInterface.getMarketplaceItem(item_id); MarketplaceScriptingInterface.getMarketplaceItem(item_id);
} }

View file

@ -298,7 +298,7 @@ Rectangle {
property bool isFreeSpecial: isStocking || isUpdate property bool isFreeSpecial: isStocking || isUpdate
enabled: isFreeSpecial || (availability === 'available') enabled: isFreeSpecial || (availability === 'available')
buttonGlyph: (enabled && !isUpdate && (price > 0)) ? hifi.glyphs.hfc : "" buttonGlyph: (enabled && !isUpdate && (price > 0)) ? hifi.glyphs.hfc : ""
text: isUpdate ? "UPDATE FOR FREE" : (isStocking ? "FREE STOCK" : (enabled ? (price || "FREE") : availability)) text: isUpdate ? "UPDATE" : (isStocking ? "FREE STOCK" : (enabled ? (price || "FREE") : availability))
color: hifi.buttons.blue color: hifi.buttons.blue
buttonGlyphSize: 24 buttonGlyphSize: 24