diff options
| author | rating89us <45968869+rating89us@users.noreply.github.com> | 2021-06-04 18:22:45 +0200 |
|---|---|---|
| committer | rating89us <rating89us@rating89us.com> | 2021-06-04 19:39:21 +0200 |
| commit | f06d6e067f60a7c4626dbdf388556d6c55b5e9ee (patch) | |
| tree | 6192c9eeabd65747e745816ea08985fd646ab24b | |
| parent | 2946127ed791ef8dd6dc430b681a14cd5bd2d71e (diff) | |
| download | monzero-gui-f06d6e067f60a7c4626dbdf388556d6c55b5e9ee.tar.gz monzero-gui-f06d6e067f60a7c4626dbdf388556d6c55b5e9ee.tar.xz monzero-gui-f06d6e067f60a7c4626dbdf388556d6c55b5e9ee.zip | |
Transfer: add XMR unit on transactions with a single recipient; move "send all" button next to Amount label
| -rw-r--r-- | components/InlineButton.qml | 5 | ||||
| -rw-r--r-- | pages/Transfer.qml | 54 |
2 files changed, 43 insertions, 16 deletions
diff --git a/components/InlineButton.qml b/components/InlineButton.qml index 8e0d278b..09d3aadf 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -95,7 +95,10 @@ Item { cursorShape: rect.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true anchors.fill: parent - onClicked: doClick() + onClicked: { + tooltip.text ? tooltip.tooltipPopup.close() : "" + doClick() + } onEntered: { tooltip.text ? tooltip.tooltipPopup.open() : "" rect.color = buttonColor ? buttonColor : "#707070"; diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 5767c951..4f918dfe 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -318,12 +318,32 @@ Rectangle { } } - MoneroComponents.TextPlain { - Layout.preferredWidth: recipientLayout.secondRowWidth - font.family: MoneroComponents.Style.fontRegular.name - font.pixelSize: 16 - color: MoneroComponents.Style.defaultFontColor - text: qsTr("Amount") + translationManager.emptyString + RowLayout { + id: amountLabel + spacing: 6 + Layout.preferredWidth: 125 + Layout.maximumWidth: recipientLayout.secondRowWidth + + MoneroComponents.TextPlain { + font.family: MoneroComponents.Style.fontRegular.name + font.pixelSize: 16 + color: MoneroComponents.Style.defaultFontColor + text: qsTr("Amount") + translationManager.emptyString + } + + MoneroComponents.InlineButton { + fontFamily: FontAwesome.fontFamilySolid + fontStyleName: "Solid" + fontPixelSize: 16 + text: FontAwesome.infinity + visible: recipientModel.count == 1 + tooltip: qsTr("Send all unlocked balance of this account") + translationManager.emptyString + onClicked: recipientRepeater.itemAt(0).children[1].children[2].text = "(all)"; + } + + Item { + Layout.fillWidth: true + } } Item { @@ -485,9 +505,10 @@ Rectangle { font.styleName: "Solid" horizontalAlignment: Text.AlignHCenter opacity: mouseArea.containsMouse ? 1 : 0.85 - text: recipientModel.count == 1 ? FontAwesome.infinity : FontAwesome.times - tooltip: recipientModel.count == 1 ? qsTr("Send all unlocked balance of this account") : qsTr("Remove recipient") + translationManager.emptyString + text: FontAwesome.times + tooltip: qsTr("Remove recipient") + translationManager.emptyString tooltipLeft: true + visible: recipientModel.count > 1 MouseArea { id: mouseArea @@ -496,15 +517,18 @@ Rectangle { hoverEnabled: true onEntered: parent.tooltipPopup.open() onExited: parent.tooltipPopup.close() - onClicked: { - if (recipientModel.count == 1) { - parent.parent.children[2].text = "(all)"; - } else { - recipientModel.remove(index); - } - } + onClicked: recipientModel.remove(index); } } + + MoneroComponents.TextPlain { + Layout.leftMargin: recipientLayout.colSpacing / 2 + Layout.preferredWidth: recipientLayout.thirdRowWidth + horizontalAlignment: Text.AlignHCenter + font.family: MoneroComponents.Style.fontRegular.name + text: "XMR" + visible: recipientModel.count == 1 + } } } } |
