[GUI] Tweaks, bug fixes, facelifts

This commit is contained in:
Nathan Hourt 2015-08-03 14:59:34 -04:00
parent eda4bae359
commit 543c505e40
3 changed files with 44 additions and 33 deletions

View file

@ -16,8 +16,8 @@ Flipable {
property bool flipped: false
Component.onCompleted: {
back = backComponent.createObject(flipable, {app: app, enabled: Qt.binding(function(){return flipped})})
front = frontComponent.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 rotation.angle < 90})})
front.canceled.connect(function() { canceled.apply(this, arguments) })
front.completed.connect(function() {
back.display.apply(this, arguments)

View file

@ -17,6 +17,8 @@ Canvas {
Jdenticon.draw(identicon, name)
else {
var context = identicon.context
if (!context) return
context.reset()
var draw_circle = function(context, x, y, radius) {
context.beginPath()

View file

@ -2,6 +2,7 @@ import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0
import Graphene.Client 0.1
@ -17,47 +18,58 @@ import "."
FormBase {
id: base
property Transaction trx
readonly property alias trx: __trx
Component.onCompleted: console.log("Made a transaction confirmation form")
Component.onDestruction: console.log("Destroyed a transaction confirmation form")
onDisplay: {
trx = app.createTransaction()
trx.clearOperations()
for (var op in arg)
trx.appendOperation(arg[op])
}
Rectangle {
width: Scaling.cm(10)
height: childrenRect.height + Scaling.cm(1)
radius: Scaling.mm(3)
color: "#EEEEEE"
border.width: Scaling.mm(.25)
border.color: "black"
Transaction {
id: __trx
}
Column {
y: Scaling.cm(.5)
x: y
width: parent.width - Scaling.cm(1)
Repeater {
model: trx? 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)
}
Rectangle {
id: trxBackground
anchors.fill: trxColumn
anchors.margins: Scaling.mm(-2)
layer.enabled: true
layer.effect: DropShadow {
radius: 8.0
samples: 16
horizontalOffset: Scaling.mm(.5)
verticalOffset: Scaling.mm(.5)
source: trxBackground
color: "#80000000"
transparentBorder: true
}
}
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 {
Label {
text: qsTr("Transaction expires in")
@ -82,10 +94,7 @@ FormBase {
app: base.app
Layout.fillWidth: true
rightButtonText: qsTr("Commit")
onLeftButtonClicked: {
canceled({})
trx = null
}
onLeftButtonClicked: canceled({})
onRightButtonClicked: {
if (app.wallet.isLocked)
app.wallet.unlock(passwordField.text)