Skip to content

Commit

Permalink
Merge pull request #1809
Browse files Browse the repository at this point in the history
fbac6f2 standard-button: handle changing text/icon at runtime (xiphon)
  • Loading branch information
luigi1111 committed Dec 18, 2018
2 parents 0c9c962 + fbac6f2 commit bac833c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions components/StandardButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bac833c

Please sign in to comment.