aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-18 13:31:39 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-18 13:31:39 -0600
commitbac833c1dd95666e159406f290ad334decee2810 (patch)
treec73edb13a64422e3ca0a814c618b46548d0836fe
parent0c9c96206e480d939af26b15cd4f5a7568397bcf (diff)
parentfbac6f2afa8cfae88d76f5870afaa373eedf86de (diff)
downloadmonzero-gui-bac833c1dd95666e159406f290ad334decee2810.tar.gz
monzero-gui-bac833c1dd95666e159406f290ad334decee2810.tar.xz
monzero-gui-bac833c1dd95666e159406f290ad334decee2810.zip
Merge pull request #1809
fbac6f2 standard-button: handle changing text/icon at runtime (xiphon)
-rw-r--r--components/StandardButton.qml19
1 files changed, 16 insertions, 3 deletions
diff --git a/components/StandardButton.qml b/components/StandardButton.qml
index 37c4c6a3..ebd41036 100644
--- a/components/StandardButton.qml
+++ b/components/StandardButton.qml
@@ -47,7 +47,8 @@ Item {
height: small ? 30 * scaleRatio : 36 * scaleRatio
width: buttonLayout.width + 22 * scaleRatio
- Component.onCompleted: width = width
+ implicitHeight: height
+ implicitWidth: width
function doClick() {
// Android workaround
@@ -106,9 +107,21 @@ Item {
horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft
font.family: MoneroComponents.Style.fontBold.name
font.bold: true
- font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize
- color: button.textColor
+ font.pixelSize: button.fontSize
+ color: !buttonArea.pressed ? button.textColor : "transparent"
visible: text !== ""
+
+ Text {
+ anchors.fill: parent
+ color: button.textColor
+ font.bold: label.font.bold
+ font.family: label.font.family
+ font.pixelSize: label.font.pixelSize - 1
+ horizontalAlignment: label.horizontalAlignment
+ Layout.alignment: label.Layout.alignment
+ text: label.text
+ visible: buttonArea.pressed
+ }
}
Image {