aboutsummaryrefslogtreecommitdiff
path: root/components/InlineButton.qml
diff options
context:
space:
mode:
authormmbyday <mmbyday@protonmail.com>2018-12-12 13:31:24 -0800
committermmbyday <mmbyday@protonmail.com>2019-02-01 15:39:41 -0800
commit6fa805df621e4dbc1ecf5f6d03cd5469421ead2e (patch)
treedb5a45e29dfb2312e3252ab4e63cc3454f0a56d7 /components/InlineButton.qml
parentc7f3deb5cc5e68891154c14275fd5dfe6bdd0a71 (diff)
downloadmonzero-gui-6fa805df621e4dbc1ecf5f6d03cd5469421ead2e.tar.gz
monzero-gui-6fa805df621e4dbc1ecf5f6d03cd5469421ead2e.tar.xz
monzero-gui-6fa805df621e4dbc1ecf5f6d03cd5469421ead2e.zip
qrscanner: update addressbook and transfer UI
Diffstat (limited to 'components/InlineButton.qml')
-rw-r--r--components/InlineButton.qml14
1 files changed, 11 insertions, 3 deletions
diff --git a/components/InlineButton.qml b/components/InlineButton.qml
index cdbcd2ef..7bd1f7d2 100644
--- a/components/InlineButton.qml
+++ b/components/InlineButton.qml
@@ -42,6 +42,7 @@ Item {
property string textColor: "#FFFFFF"
property int fontSize: 12 * scaleRatio
property alias text: inlineText.text
+ property alias buttonColor: rect.color
signal clicked()
function doClick() {
@@ -55,7 +56,7 @@ Item {
color: MoneroComponents.Style.buttonBackgroundColorDisabled
border.color: "black"
height: 28 * scaleRatio
- width: inlineText.width + 22 * scaleRatio
+ width: inlineText.text ? (inlineText.width + 22) * scaleRatio : inlineButton.icon ? (inlineImage.width + 16) * scaleRatio : rect.height
radius: 4
anchors.top: parent.top
@@ -71,6 +72,13 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
}
+ Image {
+ id: inlineImage
+ visible: inlineButton.icon !== ""
+ anchors.centerIn: parent
+ source: inlineButton.icon
+ }
+
MouseArea {
id: buttonArea
cursorShape: rect.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -78,12 +86,12 @@ Item {
anchors.fill: parent
onClicked: doClick()
onEntered: {
- rect.color = "#707070";
+ rect.color = buttonColor ? buttonColor : "#707070";
rect.opacity = 0.8;
}
onExited: {
rect.opacity = 1.0;
- rect.color = "#808080";
+ rect.color = buttonColor ? buttonColor : "#808080";
}
}
}