diff options
| author | Sander Ferdinand <sa.ferdinand@gmail.com> | 2017-11-21 22:11:41 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-03-29 23:04:00 +0100 |
| commit | e62fab767ad1f4907d56ecd9b94780a97966703f (patch) | |
| tree | 55f3ecfda3376a630d0c421a6ff41d765e2f840b /components | |
| parent | f9e264ca0a3f781a5e9e2be76e95ab1297253dc9 (diff) | |
| download | monzero-gui-e62fab767ad1f4907d56ecd9b94780a97966703f.tar.gz monzero-gui-e62fab767ad1f4907d56ecd9b94780a97966703f.tar.xz monzero-gui-e62fab767ad1f4907d56ecd9b94780a97966703f.zip | |
Added inlineButton for lineEdit and worked on network status progress bar + text
Diffstat (limited to 'components')
| -rw-r--r-- | components/InlineButton.qml | 86 | ||||
| -rw-r--r-- | components/LineEdit.qml | 6 | ||||
| -rw-r--r-- | components/NetworkStatusItem.qml | 49 | ||||
| -rw-r--r-- | components/ProgressBar.qml | 44 |
4 files changed, 160 insertions, 25 deletions
diff --git a/components/InlineButton.qml b/components/InlineButton.qml new file mode 100644 index 00000000..9ba7f716 --- /dev/null +++ b/components/InlineButton.qml @@ -0,0 +1,86 @@ +// Copyright (c) 2014-2015, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import QtQuick 2.0 +import QtQuick.Layouts 1.1 + +Item { + id: inlineButton + height: 32 * scaleRatio + property string shadowPressedColor: "#B32D00" + property string shadowReleasedColor: "#FF4304" + property string pressedColor: "#FF4304" + property string releasedColor: "#FF6C3C" + property string icon: "" + property string textColor: "#FFFFFF" + property int fontSize: 12 * scaleRatio + property alias text: inlineText.text + signal clicked() + + anchors.top: parent.top + anchors.right: parent.right + anchors.rightMargin: 8 + anchors.topMargin: 8 + + function onClicked(){} + + function doClick() { + // Android workaround + releaseFocus(); + clicked(); + } + + Rectangle{ + color: "#808080" + border.color: "black" + height: 32 + width: inlineText.width + 20 + radius: 4 + + anchors.top: parent.top + anchors.right: parent.right + + Text { + id: inlineText + font.family: Style.fontBold.name + font.pixelSize: 16 * scaleRatio + color: "#FFFFFF" + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + } + + MouseArea { + id: buttonArea + anchors.fill: parent + onClicked: doClick() + } + } + + Keys.onSpacePressed: doClick() + Keys.onReturnPressed: doClick() +} diff --git a/components/LineEdit.qml b/components/LineEdit.qml index 0cd71978..8e9e353e 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 inlineButtonText: inlineButtonId.text property int fontSize: 18 * scaleRatio property bool showBorder: true property bool error: false @@ -102,4 +103,9 @@ Item { onAccepted: item.accepted(); onTextChanged: item.textUpdated() } + + InlineButton { + id: inlineButtonId + visible: item.inlineButtonText ? true : false + } } diff --git a/components/NetworkStatusItem.qml b/components/NetworkStatusItem.qml index 440d1bb9..c7950636 100644 --- a/components/NetworkStatusItem.qml +++ b/components/NetworkStatusItem.qml @@ -28,21 +28,23 @@ import QtQuick 2.0 import moneroComponents.Wallet 1.0 +import "." 1.0 Rectangle { id: item + color: "transparent" property var connected: Wallet.ConnectionStatus_Disconnected function getConnectionStatusImage(status) { if (status == Wallet.ConnectionStatus_Connected) - return "../images/statusConnected.png" + return "../images/lightning.png" else return "../images/statusDisconnected.png" } function getConnectionStatusColor(status) { if (status == Wallet.ConnectionStatus_Connected) - return "#FF6C3B" + return "white" else return "#AAAAAA" } @@ -62,39 +64,50 @@ Rectangle { return qsTr("Invalid connection status") } - - color: "#1C1C1C" Row { - height: 60 * scaleRatio + height: 40 * scaleRatio + Item { id: iconItem - anchors.bottom: parent.bottom - width: 50 * scaleRatio - height: 50 * scaleRatio + anchors.top: parent.top + width: 40 * scaleRatio + height: 40 * scaleRatio Image { - anchors.centerIn: parent + anchors.top: parent.top + anchors.topMargin: 6 + anchors.right: parent.right + anchors.rightMargin: 11 source: getConnectionStatusImage(item.connected) } } - Column { - anchors.bottom: parent.bottom - height: 53 * scaleRatio - spacing: 3 * scaleRatio + Item { + anchors.top: parent.top + anchors.left: iconItem.right + height: 40 * scaleRatio + width: 260 * scaleRatio Text { + id: statusText anchors.left: parent.left - font.family: "Arial" - font.pixelSize: 12 * scaleRatio - color: "#545454" + anchors.top: parent.top + anchors.topMargin: 0 + font.family: Style.fontMedium.name + font.bold: true + font.pixelSize: 13 * scaleRatio + color: "white" + opacity: 0.5 text: qsTr("Network status") + translationManager.emptyString } Text { + id: statusTextVal anchors.left: parent.left - font.family: "Arial" - font.pixelSize: 18 * scaleRatio + anchors.top: parent.top + anchors.topMargin: 14 + font.family: Style.fontMedium.name + font.pixelSize: 20 * scaleRatio color: getConnectionStatusColor(item.connected) text: getConnectionStatusString(item.connected) + translationManager.emptyString } diff --git a/components/ProgressBar.qml b/components/ProgressBar.qml index 04b92b3a..e6e571e0 100644 --- a/components/ProgressBar.qml +++ b/components/ProgressBar.qml @@ -28,13 +28,15 @@ import QtQuick 2.0 import moneroComponents.Wallet 1.0 +import "." 1.0 Rectangle { id: item property int fillLevel: 0 property string syncType // Wallet or Daemon property string syncText: qsTr("%1 blocks remaining: ").arg(syncType) - color: "#1C1C1C" + visible: false + color: "transparent" function updateProgress(currentBlock,targetBlock, blocksToSync, statusTxt){ if(targetBlock > 0) { @@ -50,29 +52,57 @@ Rectangle { } Item { + anchors.topMargin: 10 * scaleRatio anchors.leftMargin: 15 * scaleRatio anchors.rightMargin: 15 * scaleRatio anchors.fill: parent + + Text { + id: progressText + anchors.top: item.top + anchors.topMargin: 6 + font.family: Style.fontMedium.name + font.pixelSize: 13 * scaleRatio + font.bold: true + color: "white" + text: qsTr("Synchronizing blocks") + height:18 * scaleRatio + } + + Text { + id: progressTextValue + anchors.top: item.top + anchors.topMargin: 6 + anchors.right: parent.right + font.family: Style.fontMedium.name + font.pixelSize: 13 * scaleRatio + font.bold: true + color: "white" + height:18 * scaleRatio + } + + Rectangle { id: bar anchors.left: parent.left anchors.right: parent.right - anchors.top: parent.top - height: 22 * scaleRatio - radius: 2 * scaleRatio - color: "#FFFFFF" + anchors.top: progressText.bottom + anchors.topMargin: 4 + height: 8 * scaleRatio + radius: 8 * scaleRatio + color: "#333333" // progressbar bg Rectangle { id: fillRect anchors.top: parent.top anchors.bottom: parent.bottom anchors.left: parent.left - anchors.margins: 2 * scaleRatio height: bar.height property int maxWidth: parent.width - 4 * scaleRatio width: (maxWidth * fillLevel) / 100 + radius: 8 color: { - if(item.fillLevel < 99 ) return "#FF6C3C" + if(item.fillLevel < 99 ) return "#FA6800" //if(item.fillLevel < 99) return "#FFE00A" return "#36B25C" } |
