Skip to content
Snippets Groups Projects
Commit 00e420c4 authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[*] Fixed a balance transfer error. Changed the design of dialog boxes.

parent bbaae925
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,31 @@ Dialog { ...@@ -6,7 +6,31 @@ Dialog {
id: dialogAddWallet id: dialogAddWallet
focus: true focus: true
modal: true modal: true
title: qsTr("Add wallet...")
header:
Rectangle
{
height: 30
color: "#353841"
Text
{
id: textTitle
leftPadding: 10
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Add wallet...")
font.family: "Roboto"
font.pixelSize: 16
color: "white"
}
Rectangle
{
anchors.bottom: parent.bottom
height: 2
width: parent.width
color: "green"
}
}
width: parent.width/1.5 width: parent.width/1.5
height: 150 height: 150
...@@ -26,8 +50,8 @@ Dialog { ...@@ -26,8 +50,8 @@ Dialog {
TextField TextField
{ {
background: Rectangle { background: Rectangle {
radius: 2 radius: 1
border.color: "gray" border.color: "green"
border.width: 1 border.width: 1
} }
...@@ -42,7 +66,7 @@ Dialog { ...@@ -42,7 +66,7 @@ Dialog {
anchors.leftMargin: 10 anchors.leftMargin: 10
font.pixelSize: 20 font.pixelSize: 20
clip: true clip: true
placeholderText: qsTr("Enter the name of the wallet")
} }
......
...@@ -6,8 +6,32 @@ Dialog { ...@@ -6,8 +6,32 @@ Dialog {
id: dialogRemoveWallet id: dialogRemoveWallet
focus: true focus: true
modal: true modal: true
title: qsTr("Remove wallet...")
header:
Rectangle
{
height: 30
color: "#353841"
Text
{
id: textTitle
leftPadding: 10
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Remove wallet...")
font.family: "Roboto"
font.pixelSize: 16
color: "white"
}
Rectangle
{
anchors.bottom: parent.bottom
height: 2
width: parent.width
color: "green"
}
}
width: parent.width/1.5 width: parent.width/1.5
height: 150 height: 150
......
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.3
import QtQuick.Controls.Private 1.0
//import QtQuick.Controls 2.5 //import QtQuick.Controls 2.5
import KelvinDashboard 1.0 import KelvinDashboard 1.0
...@@ -8,7 +10,31 @@ Dialog { ...@@ -8,7 +10,31 @@ Dialog {
id: dialogSendToken id: dialogSendToken
focus: true focus: true
modal: true modal: true
title: qsTr("Send token...")
header:
Rectangle
{
height: 30
color: "#353841"
Text
{
id: textTitle
leftPadding: 10
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Send token...")
font.family: "Roboto"
font.pixelSize: 16
color: "white"
}
Rectangle
{
anchors.bottom: parent.bottom
height: 2
width: parent.width
color: "green"
}
}
width: parent.width/1.5 width: parent.width/1.5
height: 280 height: 280
...@@ -17,6 +43,9 @@ Dialog { ...@@ -17,6 +43,9 @@ Dialog {
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
function show() { function show() {
textFieldAmount.clear()
comboBoxToken.currentIndex = -1
comboBoxAddressWallet.editText = ""
dialogSendToken.open(); dialogSendToken.open();
} }
...@@ -49,53 +78,120 @@ Dialog { ...@@ -49,53 +78,120 @@ Dialog {
// } // }
ComboBox { Row
id: comboBoxToken {
anchors { bottom: comboBoxAddressWallet.top; bottomMargin: 20; right: parent.right; rightMargin: 10; anchors { bottom: rowAddress.top; bottomMargin: 20; right: parent.right; rightMargin: 10;
left: parent.left; leftMargin: 10 } left: parent.left; leftMargin: 10 }
model: listViewTokens.model Rectangle
delegate: ItemDelegate { {
width: comboBoxToken.width id: rectangleToken
contentItem: Text { color: "green"
text: token width: 100
font: comboBoxToken.font height: comboBoxToken.height
elide: Text.ElideRight Text
verticalAlignment: Text.AlignVCenter {
font.family: "Roboto"
font.weight: Font.Thin
anchors.centerIn: parent
text: qsTr("Token")
color: "white"
}
}
ComboBox {
id: comboBoxToken
width: parent.width - rectangleToken.width
model: listViewTokens.model
displayText: currentIndex === -1 ? "Please choose..." : currentText
textRole: "token"
delegate: ItemDelegate {
width: comboBoxToken.width
contentItem: Text {
text: token
font: comboBoxToken.font
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: comboBoxToken.highlightedIndex !== index
} }
highlighted: comboBoxToken.highlightedIndex !== index onAccepted: {
currentText = listViewTokens.model.get(currentIndex).token
}
} }
} }
ComboBox { Row
id: comboBoxAddressWallet {
anchors.bottom: textFieldAmount.top id: rowAddress
anchors.bottomMargin: 20 anchors { bottom: rowAmount.top; bottomMargin: 20; right: parent.right; rightMargin: 10;
anchors.right: parent.right left: parent.left; leftMargin: 10 }
anchors.rightMargin: 10 Rectangle
anchors.left: parent.left {
anchors.leftMargin: 10 id: rectangleAddress
editable: true color: "green"
textRole: "text" width: 100
onAccepted: { height: comboBoxAddressWallet.height
if (find(currentText) === -1) { Text
model.append({text: editText}) {
// currentIndex = find(editText) font.family: "Roboto"
// fnameField.insert(currentIndex) font.weight: Font.Thin
anchors.centerIn: parent
text: qsTr("Receiver")
color: "white"
}
}
ComboBox {
id: comboBoxAddressWallet
width: parent.width - rectangleAddress.width
editable: true
textRole: "text"
editText: currentIndex === -1 ? "Please enter..." : currentText
onAccepted: {
if (find(currentText) === -1) {
model.append({text: editText})
// currentIndex = find(editText)
// fnameField.insert(currentIndex)
}
} }
} }
} }
TextField { Row
property real realValue: parseFloat(textFieldAmount.text.replace(',', '.')) * 1e12; {
id: rowAmount
anchors { bottom: buttonCancel.top; bottomMargin: 20; right: parent.right; rightMargin: 10;
left: parent.left; leftMargin: 10 }
Rectangle
{
id: rectangleAmount
color: "green"
width: 100
height: comboBoxToken.height
Text
{
font.family: "Roboto"
font.weight: Font.Thin
anchors.centerIn: parent
text: qsTr("Amount")
color: "white"
}
}
id: textFieldAmount TextField {
anchors.bottom: buttonOk.top property real realValue: parseFloat(textFieldAmount.text.replace(',', '.')) * 1e12;
anchors.bottomMargin: 20 height: rectangleAmount.height
anchors.right: parent.right width: parent.width - rectangleAmount.width
anchors.rightMargin: 10 id: textFieldAmount
placeholderText: "Amount (Ex. 2,9103)" placeholderText: "Amount (Ex. 2,9103)"
validator: DoubleValidator{} validator: DoubleValidator{}
background: Rectangle {
radius: 1
border.color: "green"
border.width: 1
}
}
} }
Button Button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment