[GUI] Tweaks, bug fixes, facelifts
This commit is contained in:
parent
eda4bae359
commit
543c505e40
3 changed files with 44 additions and 33 deletions
|
|
@ -16,8 +16,8 @@ Flipable {
|
||||||
property bool flipped: false
|
property bool flipped: false
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
back = backComponent.createObject(flipable, {app: app, enabled: Qt.binding(function(){return flipped})})
|
back = backComponent.createObject(flipable, {app: app, enabled: Qt.binding(function(){return rotation.angle > 90})})
|
||||||
front = frontComponent.createObject(flipable, {app: app, enabled: Qt.binding(function(){return !flipped})})
|
front = frontComponent.createObject(flipable, {app: app, enabled: Qt.binding(function(){return rotation.angle < 90})})
|
||||||
front.canceled.connect(function() { canceled.apply(this, arguments) })
|
front.canceled.connect(function() { canceled.apply(this, arguments) })
|
||||||
front.completed.connect(function() {
|
front.completed.connect(function() {
|
||||||
back.display.apply(this, arguments)
|
back.display.apply(this, arguments)
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ Canvas {
|
||||||
Jdenticon.draw(identicon, name)
|
Jdenticon.draw(identicon, name)
|
||||||
else {
|
else {
|
||||||
var context = identicon.context
|
var context = identicon.context
|
||||||
|
if (!context) return
|
||||||
|
|
||||||
context.reset()
|
context.reset()
|
||||||
var draw_circle = function(context, x, y, radius) {
|
var draw_circle = function(context, x, y, radius) {
|
||||||
context.beginPath()
|
context.beginPath()
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Dialogs 1.2
|
import QtQuick.Dialogs 1.2
|
||||||
import QtQuick.Layouts 1.2
|
import QtQuick.Layouts 1.2
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
import Graphene.Client 0.1
|
import Graphene.Client 0.1
|
||||||
|
|
||||||
|
|
@ -17,47 +18,58 @@ import "."
|
||||||
FormBase {
|
FormBase {
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
property Transaction trx
|
readonly property alias trx: __trx
|
||||||
|
|
||||||
Component.onCompleted: console.log("Made a transaction confirmation form")
|
Component.onCompleted: console.log("Made a transaction confirmation form")
|
||||||
Component.onDestruction: console.log("Destroyed a transaction confirmation form")
|
Component.onDestruction: console.log("Destroyed a transaction confirmation form")
|
||||||
|
|
||||||
onDisplay: {
|
onDisplay: {
|
||||||
trx = app.createTransaction()
|
trx.clearOperations()
|
||||||
for (var op in arg)
|
for (var op in arg)
|
||||||
trx.appendOperation(arg[op])
|
trx.appendOperation(arg[op])
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Transaction {
|
||||||
width: Scaling.cm(10)
|
id: __trx
|
||||||
height: childrenRect.height + Scaling.cm(1)
|
}
|
||||||
radius: Scaling.mm(3)
|
|
||||||
color: "#EEEEEE"
|
|
||||||
border.width: Scaling.mm(.25)
|
|
||||||
border.color: "black"
|
|
||||||
|
|
||||||
Column {
|
Rectangle {
|
||||||
y: Scaling.cm(.5)
|
id: trxBackground
|
||||||
x: y
|
anchors.fill: trxColumn
|
||||||
width: parent.width - Scaling.cm(1)
|
anchors.margins: Scaling.mm(-2)
|
||||||
Repeater {
|
layer.enabled: true
|
||||||
model: trx? trx.operations : []
|
layer.effect: DropShadow {
|
||||||
Label {
|
radius: 8.0
|
||||||
property Asset transferAsset: app.model.getAsset(modelData.amountType)
|
samples: 16
|
||||||
property Asset feeAsset: app.model.getAsset(modelData.feeType)
|
horizontalOffset: Scaling.mm(.5)
|
||||||
text: {
|
verticalOffset: Scaling.mm(.5)
|
||||||
return qsTr("Transfer %1 %2 from %3 to %4\nFee: %5 %6").arg(transferAsset.formatAmount(modelData.amount))
|
source: trxBackground
|
||||||
.arg(transferAsset.symbol)
|
color: "#80000000"
|
||||||
.arg(app.model.getAccount(modelData.sender).name)
|
transparentBorder: true
|
||||||
.arg(app.model.getAccount(modelData.receiver).name)
|
}
|
||||||
.arg(feeAsset.formatAmount(modelData.fee))
|
}
|
||||||
.arg(feeAsset.symbol)
|
Column {
|
||||||
}
|
id: trxColumn
|
||||||
|
Layout.preferredWidth: Scaling.cm(10)
|
||||||
|
spacing: Scaling.mm(2)
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||||
|
model: trx.operations
|
||||||
|
Label {
|
||||||
|
property Asset transferAsset: app.model.getAsset(modelData.amountType)
|
||||||
|
property Asset feeAsset: app.model.getAsset(modelData.feeType)
|
||||||
|
text: {
|
||||||
|
return qsTr("Transfer %1 %2 from %3 to %4\nFee: %5 %6").arg(transferAsset.formatAmount(modelData.amount))
|
||||||
|
.arg(transferAsset.symbol)
|
||||||
|
.arg(app.model.getAccount(modelData.sender).name)
|
||||||
|
.arg(app.model.getAccount(modelData.receiver).name)
|
||||||
|
.arg(feeAsset.formatAmount(modelData.fee))
|
||||||
|
.arg(feeAsset.symbol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item { width: 1; height: 1 }
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Transaction expires in")
|
text: qsTr("Transaction expires in")
|
||||||
|
|
@ -82,10 +94,7 @@ FormBase {
|
||||||
app: base.app
|
app: base.app
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
rightButtonText: qsTr("Commit")
|
rightButtonText: qsTr("Commit")
|
||||||
onLeftButtonClicked: {
|
onLeftButtonClicked: canceled({})
|
||||||
canceled({})
|
|
||||||
trx = null
|
|
||||||
}
|
|
||||||
onRightButtonClicked: {
|
onRightButtonClicked: {
|
||||||
if (app.wallet.isLocked)
|
if (app.wallet.isLocked)
|
||||||
app.wallet.unlock(passwordField.text)
|
app.wallet.unlock(passwordField.text)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue