From 8b1b28d2702360d8f68010aa573c04d6675c4690 Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 28 Jan 2015 19:11:14 +0100 Subject: [PATCH] ui tweaks --- mix/MixClient.cpp | 1 - mix/qml/Ether.qml | 115 ++++++++++++++++++---------------------------- 2 files changed, 45 insertions(+), 71 deletions(-) diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index ac1d5eba2..e582564c0 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -36,7 +36,6 @@ using namespace dev; using namespace dev::eth; using namespace dev::mix; - const Secret c_stdSecret = Secret("cb73d9408c4720e230387d956eb0f829d8a4dd2c1055f96257167e14e7169074"); MixClient::MixClient(): diff --git a/mix/qml/Ether.qml b/mix/qml/Ether.qml index 9eb9b63e0..a5fd5dba2 100644 --- a/mix/qml/Ether.qml +++ b/mix/qml/Ether.qml @@ -10,7 +10,7 @@ import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 -Rectangle { +RowLayout { id: etherEdition property bool displayFormattedValue; property bool edit; @@ -32,84 +32,59 @@ Rectangle { units.currentIndex = unit; } - RowLayout + TextField { - anchors.fill: parent; - id: row - width: 200 - height: parent.height - Rectangle + implicitWidth: 200 + onTextChanged: { - width : 200 - color: edit ? "blue" : "white" - TextField + if (value !== undefined) { - onTextChanged: - { - if (value !== undefined) - { - value.setValue(text) - formattedValue.text = value.format(); - } - } - width: parent.width - readOnly: !edit - visible: edit - id: etherValueEdit; + value.setValue(text) + formattedValue.text = value.format(); } } + readOnly: !edit + visible: edit + id: etherValueEdit; + } - Rectangle + ComboBox + { + id: units + onCurrentTextChanged: { - Layout.fillWidth: true - id: unitContainer - width: 20 - anchors.verticalCenter: parent.verticalCenter - ComboBox - { - id: units - onCurrentTextChanged: - { - if (value !== undefined) - { - value.setUnit(currentText); - formattedValue.text = value.format(); - } - } - model: ListModel { - id: unitsModel - ListElement { text: "Uether"; } - ListElement { text: "Vether"; } - ListElement { text: "Dether"; } - ListElement { text: "Nether"; } - ListElement { text: "Yether"; } - ListElement { text: "Zether"; } - ListElement { text: "Eether"; } - ListElement { text: "Pether"; } - ListElement { text: "Tether"; } - ListElement { text: "Gether"; } - ListElement { text: "Mether"; } - ListElement { text: "grand"; } - ListElement { text: "ether"; } - ListElement { text: "finney"; } - ListElement { text: "szabo"; } - ListElement { text: "Gwei"; } - ListElement { text: "Mwei"; } - ListElement { text: "Kwei"; } - ListElement { text: "wei"; } - } - } - Rectangle + if (value !== undefined) { - anchors.verticalCenter: parent.verticalCenter - anchors.left: units.right - visible: displayFormattedValue - width: 20 - Text - { - id: formattedValue - } + value.setUnit(currentText); + formattedValue.text = value.format(); } } + model: ListModel { + id: unitsModel + ListElement { text: "Uether"; } + ListElement { text: "Vether"; } + ListElement { text: "Dether"; } + ListElement { text: "Nether"; } + ListElement { text: "Yether"; } + ListElement { text: "Zether"; } + ListElement { text: "Eether"; } + ListElement { text: "Pether"; } + ListElement { text: "Tether"; } + ListElement { text: "Gether"; } + ListElement { text: "Mether"; } + ListElement { text: "grand"; } + ListElement { text: "ether"; } + ListElement { text: "finney"; } + ListElement { text: "szabo"; } + ListElement { text: "Gwei"; } + ListElement { text: "Mwei"; } + ListElement { text: "Kwei"; } + ListElement { text: "wei"; } + } + } + Text + { + visible: displayFormattedValue + id: formattedValue } }