mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Case 21704 - marketplace button formatting fixes
This commit is contained in:
parent
822e5ceb98
commit
42bf812019
2 changed files with 11 additions and 1 deletions
|
@ -143,6 +143,16 @@ Original.Button {
|
|||
horizontalAlignment: Text.AlignHCenter
|
||||
text: control.text
|
||||
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 !== "") {
|
||||
buttonText.x = buttonContentItem.width/2 - buttonTextMetrics.width/2 + (buttonGlyphTextMetrics.width + control.buttonGlyphRightMargin)/2;
|
||||
} else {
|
||||
|
|
|
@ -298,7 +298,7 @@ Rectangle {
|
|||
property bool isFreeSpecial: isStocking || isUpdate
|
||||
enabled: isFreeSpecial || (availability === 'available')
|
||||
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
|
||||
|
||||
buttonGlyphSize: 24
|
||||
|
|
Loading…
Reference in a new issue