Merge pull request #1809

fbac6f2 standard-button: handle changing text/icon at runtime (xiphon)
This commit is contained in:
luigi1111 2018-12-18 13:31:39 -06:00
commit bac833c1dd
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -47,7 +47,8 @@ Item {
height: small ? 30 * scaleRatio : 36 * scaleRatio height: small ? 30 * scaleRatio : 36 * scaleRatio
width: buttonLayout.width + 22 * scaleRatio width: buttonLayout.width + 22 * scaleRatio
Component.onCompleted: width = width implicitHeight: height
implicitWidth: width
function doClick() { function doClick() {
// Android workaround // Android workaround
@ -106,9 +107,21 @@ Item {
horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft horizontalAlignment: textAlign === "center" ? Text.AlignHCenter : Text.AlignLeft
font.family: MoneroComponents.Style.fontBold.name font.family: MoneroComponents.Style.fontBold.name
font.bold: true font.bold: true
font.pixelSize: buttonArea.pressed ? button.fontSize - 1 : button.fontSize font.pixelSize: button.fontSize
color: button.textColor color: !buttonArea.pressed ? button.textColor : "transparent"
visible: text !== "" 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 { Image {