From 6d21b9919d5fc100eb3565fbe6038007c45ce078 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Sat, 25 Nov 2017 22:53:07 +0100 Subject: [PATCH] InlineButton development --- components/InlineButton.qml | 13 +++-- components/Input.qml | 1 + components/LineEdit.qml | 8 +-- pages/Transfer.qml | 104 +++++++++++++++--------------------- 4 files changed, 54 insertions(+), 72 deletions(-) diff --git a/components/InlineButton.qml b/components/InlineButton.qml index da8120c3..9e3f3c04 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -47,10 +47,6 @@ Item { anchors.rightMargin: 8 anchors.topMargin: 8 - function onClicked(){ - console.log("debug click"); - } - function doClick() { // Android workaround releaseFocus(); @@ -58,10 +54,11 @@ Item { } Rectangle{ - color: "#808080" + id: rect + color: rect.enabled ? "#808080" : "#3b3b3b" border.color: "black" height: 32 - width: inlineText.width + 20 + width: inlineText.width + 22 radius: 4 anchors.top: parent.top @@ -70,14 +67,16 @@ Item { Text { id: inlineText font.family: Style.fontBold.name + font.bold: true font.pixelSize: 16 * scaleRatio - color: "#FFFFFF" + color: "black" anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter } MouseArea { id: buttonArea + cursorShape: Qt.PointingHandCursor anchors.fill: parent onClicked: doClick() } diff --git a/components/Input.qml b/components/Input.qml index b7e39eb2..6643af14 100644 --- a/components/Input.qml +++ b/components/Input.qml @@ -33,6 +33,7 @@ import "." 1.0 TextField { font.family: Style.fontRegular.name font.pixelSize: 22 + font.bold: true horizontalAlignment: TextInput.AlignLeft selectByMouse: true color: "white" diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 964af52f..c6cd65de 100644 --- a/components/LineEdit.qml +++ b/components/LineEdit.qml @@ -37,6 +37,7 @@ Item { property alias readOnly : input.readOnly property alias cursorPosition: input.cursorPosition property alias echoMode: input.echoMode + property alias inlineButton: inlineButtonId property alias inlineButtonText: inlineButtonId.text property alias inlineIcon: inlineIcon.visible property int fontSize: 18 * scaleRatio @@ -70,9 +71,9 @@ Item { function getColor(error) { // @TODO: replace/remove this (implement as ternary?) if (error) - return Style.inputBoxBackground + return "transparent" else - return Style.inputBoxBackground + return "transparent" } Text { @@ -85,7 +86,7 @@ Item { font.pixelSize: 20 * scaleRatio color: "#FFFFFF" text: "" - visible: item.setPlaceholder() ? false : true + visible: input.text ? false : true z: 3 } @@ -128,6 +129,7 @@ Item { InlineButton { id: inlineButtonId + onClicked: inlineButtonId.onClicked visible: item.inlineButtonText ? true : false } } diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 6816db7c..2647dbaf 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -30,8 +30,8 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 import moneroComponents.PendingTransaction 1.0 -import "../components" import moneroComponents.Wallet 1.0 +import "../components" import "." 1.0 @@ -41,10 +41,18 @@ Rectangle { int priority, string description) signal sweepUnmixableClicked() - color: "black" + color: "transparent" property string startLinkText: qsTr(" (Start daemon)") + translationManager.emptyString property bool showAdvanced: false + Image { + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + height: panel.height + source: "../images/leftPanelBg.jpg" + } + function scaleValueToMixinCount(scaleValue) { var scaleToMixinCount = [6,7,8,9,10,11,12,13,14,16,18,20,22,25]; if (scaleValue < scaleToMixinCount.length) { @@ -119,6 +127,7 @@ Rectangle { RowLayout{ Layout.fillWidth: true Layout.bottomMargin: 20 + height: 150 Text { id: panelHeader @@ -144,22 +153,16 @@ Rectangle { Layout.fillWidth: true id: amountRow Layout.minimumWidth: 200 - Item { - visible: !isMobile - width: 37 * scaleRatio - height: 37 * scaleRatio - Image { - anchors.centerIn: parent - source: "../images/moneroIcon.png" - } - } // Amount input LineEdit { - Layout.fillWidth: true id: amountLine + Layout.fillWidth: true + inlineIcon: true placeholderText: qsTr("") + translationManager.emptyString - width:100 + width: 100 + inlineButtonText: qsTr("All") + translationManager.emptyString + inlineButton.onClicked: amountLine.text = "(all)" validator: DoubleValidator { bottom: 0.0 top: 18446744.073709551615 @@ -168,21 +171,7 @@ Rectangle { locale: "C" } } - - StandardButton { - id: amountAllButton - width: 60 * scaleRatio - text: qsTr("All") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" - enabled : true - onClicked: amountLine.text = "(all)" - } } - - } ColumnLayout { @@ -197,7 +186,20 @@ Rectangle { // ListElement { column1: qsTr("LOW") + translationManager.emptyString ; column2: ""; priority: PendingTransaction.Priority_Low } // For translations to work, the strings need to be listed in // the file components/StandardDropdown.qml too. +<<<<<<< HEAD +======= + + // Priorities before v5 + ListModel { + id: priorityModel + + ListElement { column1: qsTr("Low (x1 fee)") ; column2: ""; priority: PendingTransaction.Priority_Low } + ListElement { column1: qsTr("Medium (x20 fee)") ; column2: ""; priority: PendingTransaction.Priority_Medium } + ListElement { column1: qsTr("High (x166 fee)") ; column2: ""; priority: PendingTransaction.Priority_High } + } + +>>>>>>> InlineButton development // Priorites after v5 ListModel { id: priorityModelV5 @@ -215,45 +217,32 @@ Rectangle { id: priorityDropdown shadowReleasedColor: "#FF4304" shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" + releasedColor: "black" + pressedColor: "#404040" } } // Make sure dropdown is on top z: parent.z + 1 } - ColumnLayout { - id: amountRowx - Label { - id: amountLabelx - text: qsTr("Amount") + translationManager.emptyString - width: mainLayout.labelWidth - } - - // this LineEdit is for testing purposes - LineEdit { - id: amountLinex - fontSize: mainLayout.lineEditFontSize - placeholderText: qsTr("Amount to receive") + translationManager.emptyString - readOnly: false - width: mainLayout.editWidth - Layout.fillWidth: true - inlineButtonText: "Testy" - } - } - ColumnLayout { Layout.fillWidth: true Label { id: addressLabel textFormat: Text.RichText +<<<<<<< HEAD text: "" + qsTr("Address") + " ( " + qsTr("Paste in or select from Address book") + " )" + translationManager.emptyString +======= + text: qsTr("\ + Address ( Paste in or select from Address book )") + + translationManager.emptyString + +>>>>>>> InlineButton development onLinkActivated: appWindow.showPageRequest("AddressBook") Layout.fillWidth: true } @@ -282,19 +271,9 @@ Rectangle { Layout.fillWidth: true anchors.topMargin: 5 * scaleRatio placeholderText: "4..." - // validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g } - } - - StandardButton { - id: resolveButton - width: 60 * scaleRatio - text: qsTr("Resolve") + translationManager.emptyString - shadowReleasedColor: "#FF4304" - shadowPressedColor: "#B32D00" - releasedColor: "#FF6C3C" - pressedColor: "#FF4304" - enabled : isValidOpenAliasAddress(addressLine.text) - onClicked: { + inlineButtonText: qsTr("Resolve") + translationManager.emptyString + inlineButton.enabled: isValidOpenAliasAddress(addressLine.text) + inlineButton.onClicked: { var result = walletManager.resolveOpenAlias(addressLine.text) if (result) { var parts = result.split("|") @@ -325,6 +304,7 @@ Rectangle { oa_message(qsTr("No address found")) } } + // validator: RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g } } }