From ccb1f360837535f0567ba03da07f90f796a3f6e5 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Tue, 4 Sep 2018 11:15:40 +0200 Subject: [PATCH 1/2] Changed regex to support amount lines starting with a period, but block the transaction creation wizard --- pages/Transfer.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/Transfer.qml b/pages/Transfer.qml index c398eaf8..657a033c 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -162,7 +162,7 @@ Rectangle { inlineButton.onClicked: amountLine.text = "(all)" validator: RegExpValidator { - regExp: /(\d{1,8})([.]\d{1,12})?$/ + regExp: /(.|)(\d{1,8})([.]\d{1,12})?$/ } } } @@ -337,7 +337,12 @@ Rectangle { if(parseFloat(amountLine.text) > parseFloat(unlockedBalanceText)){ return false; } - + + // The amount does not start with a period (example: `.4`) + if(amountLine.text.startsWith('.')){ + return false; + } + return true; } onClicked: { From 94e3d984527514f8c140403ad7ded1cc2d069e0b Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Tue, 4 Sep 2018 11:15:55 +0200 Subject: [PATCH 2/2] Increased left margin for the amount text --- components/LineEdit.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 9eb50b04..3a5c2769 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -196,7 +196,7 @@ Item { MoneroComponents.Input { id: input anchors.fill: parent - anchors.leftMargin: inlineIcon.visible ? 38 : 0 + anchors.leftMargin: inlineIcon.visible ? 44 * scaleRatio : 0 font.pixelSize: item.fontSize font.bold: item.fontBold onEditingFinished: item.editingFinished()