Browse Source

qml: styling TxDetails

master
Sander van Grieken 3 years ago
parent
commit
5fd8b63091
  1. 108
      electrum/gui/qml/components/TxDetails.qml

108
electrum/gui/qml/components/TxDetails.qml

@ -11,8 +11,7 @@ Pane {
id: root id: root
width: parent.width width: parent.width
height: parent.height height: parent.height
padding: 0
// property string title: qsTr("Transaction details")
property string txid property string txid
property string rawtx property string rawtx
@ -25,68 +24,23 @@ Pane {
app.stack.pop() app.stack.pop()
} }
property QtObject menu: Menu { ColumnLayout {
id: menu anchors.fill: parent
parent: Overlay.overlay spacing: 0
dim: true
Overlay.modeless: Rectangle {
color: "#44000000"
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Export')
onTriggered: {
var dialog = exportTxDialog.createObject(root, { txdetails: txdetails })
dialog.open()
}
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Bump fee')
enabled: txdetails.canBump
onTriggered: {
var dialog = bumpFeeDialog.createObject(root, { txid: root.txid })
dialog.open()
}
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Child pays for parent')
enabled: txdetails.canCpfp
onTriggered: notificationPopup.show('Not implemented')
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Cancel double-spend')
enabled: txdetails.canCancel
onTriggered: notificationPopup.show('Not implemented')
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Remove')
enabled: txdetails.canRemove
onTriggered: txdetails.removeLocalTx()
}
}
}
Flickable { Flickable {
anchors.fill: parent Layout.fillWidth: true
contentHeight: rootLayout.height Layout.fillHeight: true
Layout.topMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
contentHeight: contentLayout.height
clip: true clip: true
interactive: height < contentHeight interactive: height < contentHeight
GridLayout { GridLayout {
id: rootLayout id: contentLayout
width: parent.width width: parent.width
columns: 2 columns: 2
@ -377,24 +331,56 @@ Pane {
} }
} }
} }
}
}
RowLayout { RowLayout {
visible: !txdetails.isMined && !txdetails.isUnrelated visible: !txdetails.isMined && !txdetails.isUnrelated
Layout.columnSpan: 2 FlatButton {
Button { Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Sign') text: qsTr('Sign')
enabled: txdetails.canSign enabled: txdetails.canSign
onClicked: txdetails.sign() onClicked: txdetails.sign()
} }
Button { FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Broadcast') text: qsTr('Broadcast')
enabled: txdetails.canBroadcast enabled: txdetails.canBroadcast
onClicked: txdetails.broadcast() onClicked: txdetails.broadcast()
} }
} }
FlatButton {
Layout.fillWidth: true
text: qsTr('Export')
onClicked: {
var dialog = exportTxDialog.createObject(root, { txdetails: txdetails })
dialog.open()
} }
} }
FlatButton {
Layout.fillWidth: true
text: qsTr('Bump fee')
visible: txdetails.canBump
onClicked: {
var dialog = bumpFeeDialog.createObject(root, { txid: root.txid })
dialog.open()
}
}
FlatButton {
Layout.fillWidth: true
text: qsTr('Remove')
visible: txdetails.canRemove
onClicked: txdetails.removeLocalTx()
}
}
TxDetails { TxDetails {
id: txdetails id: txdetails
wallet: Daemon.currentWallet wallet: Daemon.currentWallet

Loading…
Cancel
Save