diff options
| author | Jaquee <jaquee.monero@gmail.com> | 2017-08-08 10:44:11 +0200 |
|---|---|---|
| committer | Jaquee <jaquee.monero@gmail.com> | 2017-11-03 16:57:11 +0100 |
| commit | b82a17aa97141a32f0b4dc4adf5b0fa753840ecc (patch) | |
| tree | 60ac8c7025ecdca0334a33437ee44432befd9971 /components | |
| parent | 31675f4c16a3f7c34c21569b27b8afadc6dc6e74 (diff) | |
| download | monzero-gui-b82a17aa97141a32f0b4dc4adf5b0fa753840ecc.tar.gz monzero-gui-b82a17aa97141a32f0b4dc4adf5b0fa753840ecc.tar.xz monzero-gui-b82a17aa97141a32f0b4dc4adf5b0fa753840ecc.zip | |
progressBar redesign
Diffstat (limited to 'components')
| -rw-r--r-- | components/ProgressBar.qml | 93 |
1 files changed, 53 insertions, 40 deletions
diff --git a/components/ProgressBar.qml b/components/ProgressBar.qml index 0c1519de..8f462122 100644 --- a/components/ProgressBar.qml +++ b/components/ProgressBar.qml @@ -29,15 +29,13 @@ import QtQuick 2.0 import moneroComponents.Wallet 1.0 -Item { +Rectangle { id: item property int fillLevel: 0 - height: 22 - anchors.margins:15 visible: false - //clip: true + color: "#1C1C1C" - function updateProgress(currentBlock,targetBlock, blocksToSync){ + function updateProgress(currentBlock,targetBlock, blocksToSync, statusTxt){ if(targetBlock == 1) { fillLevel = 0 progressText.text = qsTr("Establishing connection..."); @@ -54,53 +52,68 @@ Item { else var progressLevel = (100*(currentBlock/targetBlock)).toFixed(0); fillLevel = progressLevel - progressText.text = qsTr("Blocks remaining: %1").arg(remaining.toFixed(0)); + if(typeof statusTxt != "undefined" && statusTxt != "") { + progressText.text = statusTxt + (" %1").arg(remaining.toFixed(0)); + } else { + progressText.text = qsTr("Blocks remaining: %1").arg(remaining.toFixed(0)); + } + + + progressBar.visible = currentBlock < targetBlock } } - Rectangle { - id: bar - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - height: 22 - radius: 2 - color: "#FFFFFF" - + Item { + anchors.leftMargin: 15 * scaleRatio + anchors.rightMargin: 15 * scaleRatio + anchors.fill: parent Rectangle { - id: fillRect - anchors.top: parent.top - anchors.bottom: parent.bottom + id: bar anchors.left: parent.left - anchors.margins: 2 - height: bar.height - property int maxWidth: parent.width - 4 - width: (maxWidth * fillLevel) / 100 - color: { - if(item.fillLevel < 99 ) return "#FF6C3C" - //if(item.fillLevel < 99) return "#FFE00A" - return "#36B25C" - } + anchors.right: parent.right + anchors.top: parent.top + height: 22 * scaleRatio + radius: 2 * scaleRatio + color: "#FFFFFF" - } + 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 + color: { + if(item.fillLevel < 99 ) return "#FF6C3C" + //if(item.fillLevel < 99) return "#FFE00A" + return "#36B25C" + } - Rectangle { - color:"#333" - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.leftMargin: 8 + } - Text { - id:progressText + Rectangle { + color:"#333" anchors.bottom: parent.bottom - font.family: "Arial" - font.pixelSize: 12 - color: "#000" - text: qsTr("Synchronizing blocks") - height:18 + anchors.left: parent.left + anchors.leftMargin: 8 * scaleRatio + + Text { + id:progressText + anchors.bottom: parent.bottom + font.family: "Arial" + font.pixelSize: 12 * scaleRatio + color: "#000" + text: qsTr("Synchronizing blocks") + height:18 * scaleRatio + } } } + } + + } |
