Browse Source

ui tweaks

cl-refactor
arkpar 10 years ago
parent
commit
8b1b28d270
  1. 1
      mix/MixClient.cpp
  2. 115
      mix/qml/Ether.qml

1
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():

115
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
}
}

Loading…
Cancel
Save