Browse Source

qml: put FlatButtons in ButtonContainer where (potentially) more buttons are grouped

master
Sander van Grieken 3 years ago
parent
commit
b2a02dd047
  1. 26
      electrum/gui/qml/components/ChannelDetails.qml
  2. 6
      electrum/gui/qml/components/Channels.qml
  3. 4
      electrum/gui/qml/components/ExportTxDialog.qml
  4. 7
      electrum/gui/qml/components/InvoiceDialog.qml
  5. 7
      electrum/gui/qml/components/NetworkOverview.qml
  6. 2
      electrum/gui/qml/components/ReceiveDialog.qml
  7. 7
      electrum/gui/qml/components/SendDialog.qml
  8. 11
      electrum/gui/qml/components/TxDetails.qml
  9. 8
      electrum/gui/qml/components/WalletDetails.qml
  10. 42
      electrum/gui/qml/components/WalletMainView.qml

26
electrum/gui/qml/components/ChannelDetails.qml

@ -203,19 +203,21 @@ Pane {
}
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
visible: !channeldetails.isBackup
text: qsTr('Backup');
text: qsTr('Backup')
onClicked: {
var dialog = app.genericShareDialog.createObject(root,
{
var dialog = app.genericShareDialog.createObject(root, {
title: qsTr('Channel Backup for %1').arg(channeldetails.short_cid),
text: channeldetails.channelBackup(),
text_help: channeldetails.channelBackupHelpText(),
iconSource: Qt.resolvedUrl('../../icons/file.png')
}
)
})
dialog.open()
}
icon.source: '../../icons/file.png'
@ -227,7 +229,7 @@ Pane {
text: qsTr('Close channel');
visible: channeldetails.canClose
onClicked: {
var dialog = closechannel.createObject(root, { 'channelid': channelid })
var dialog = closechannel.createObject(root, { channelid: channelid })
dialog.open()
}
icon.source: '../../icons/closebutton.png'
@ -239,12 +241,10 @@ Pane {
text: qsTr('Delete channel');
visible: channeldetails.canDelete
onClicked: {
var dialog = app.messageDialog.createObject(root,
{
'text': qsTr('Are you sure you want to delete this channel? This will purge associated transactions from your wallet history.'),
'yesno': true
}
)
var dialog = app.messageDialog.createObject(root, {
text: qsTr('Are you sure you want to delete this channel? This will purge associated transactions from your wallet history.'),
yesno: true
})
dialog.yesClicked.connect(function() {
channeldetails.deleteChannel()
app.stack.pop()
@ -257,6 +257,8 @@ Pane {
}
}
}
ChannelDetails {
id: channeldetails
wallet: Daemon.currentWallet

6
electrum/gui/qml/components/Channels.qml

@ -103,8 +103,11 @@ Pane {
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Swap');
visible: Daemon.currentWallet.lightningCanSend.satsInt > 0 || Daemon.currentWallet.lightningCanReceive.satInt > 0
icon.source: '../../icons/status_waiting.png'
@ -116,6 +119,7 @@ Pane {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Open Channel')
onClicked: {
var dialog = openChannelDialog.createObject(root)
@ -126,12 +130,14 @@ Pane {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Channel backups')
onClicked: {
app.stack.push(Qt.resolvedUrl('ChannelBackups.qml'))
}
icon.source: '../../icons/file.png'
}
}
}

4
electrum/gui/qml/components/ExportTxDialog.qml

@ -64,8 +64,8 @@ ElDialog {
color: Material.accentColor
}
RowLayout {
Layout.fillWidth: true
ButtonContainer {
// Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
FlatButton {

7
electrum/gui/qml/components/InvoiceDialog.qml

@ -337,8 +337,12 @@ ElDialog {
}
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Pay')
icon.source: '../../icons/confirmed.png'
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay && !amountContainer.editmode
@ -351,6 +355,7 @@ ElDialog {
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Delete')
icon.source: '../../icons/delete.png'
visible: invoice_key != ''
@ -362,6 +367,7 @@ ElDialog {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Save')
icon.source: '../../icons/save.png'
visible: invoice_key == ''
@ -372,6 +378,7 @@ ElDialog {
dialog.close()
}
}
}
}

7
electrum/gui/qml/components/NetworkOverview.qml

@ -161,8 +161,12 @@ Pane {
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Server Settings');
icon.source: '../../icons/network.png'
onClicked: {
@ -173,6 +177,7 @@ Pane {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Proxy Settings');
icon.source: '../../icons/status_connected_proxy.png'
onClicked: {
@ -180,7 +185,7 @@ Pane {
dialog.open()
}
}
}
}
function setFeeHistogram() {

2
electrum/gui/qml/components/ReceiveDialog.qml

@ -241,7 +241,7 @@ ElDialog {
color: Material.accentColor
}
RowLayout {
ButtonContainer {
id: buttons
Layout.alignment: Qt.AlignHCenter
FlatButton {

7
electrum/gui/qml/components/SendDialog.qml

@ -49,8 +49,12 @@ ElDialog {
onFound: dialog.dispatch(scanData)
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
icon.source: '../../icons/pen.png'
text: qsTr('Manual input')
onClicked: {
@ -64,12 +68,15 @@ ElDialog {
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
icon.source: '../../icons/paste.png'
text: qsTr('Paste from clipboard')
onClicked: dialog.dispatch(AppController.clipboardToText())
}
}
}
Component {
id: manualInputDialog
ElDialog {

11
electrum/gui/qml/components/TxDetails.qml

@ -315,8 +315,10 @@ Pane {
}
RowLayout {
ButtonContainer {
Layout.fillWidth: true
visible: txdetails.canSign || txdetails.canBroadcast
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
@ -333,7 +335,9 @@ Pane {
}
}
RowLayout {
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
@ -359,10 +363,10 @@ Pane {
visible: txdetails.canRemove
onClicked: txdetails.removeLocalTx()
}
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Cancel Tx')
visible: txdetails.canCancel
onClicked: {
@ -370,6 +374,7 @@ Pane {
dialog.open()
}
}
}
}

8
electrum/gui/qml/components/WalletDetails.qml

@ -460,8 +460,12 @@ Pane {
}
}
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
visible: Daemon.currentWallet.walletType == 'imported'
text: Daemon.currentWallet.isWatchOnly
? qsTr('Import additional addresses')
@ -470,24 +474,28 @@ Pane {
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Change Password')
onClicked: rootItem.changePassword()
icon.source: '../../icons/lock.png'
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Delete Wallet')
onClicked: rootItem.deleteWallet()
icon.source: '../../icons/delete.png'
}
FlatButton {
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Enable Lightning')
onClicked: rootItem.enableLightning()
visible: Daemon.currentWallet && Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning
icon.source: '../../icons/lightning.png'
}
}
}
Connections {
target: Daemon

42
electrum/gui/qml/components/WalletMainView.qml

@ -154,8 +154,8 @@ Item {
}
}
RowLayout {
spacing: 0
ButtonContainer {
Layout.fillWidth: true
FlatButton {
Layout.fillWidth: false
@ -169,17 +169,17 @@ Item {
mainView.menu.y = mainView.height - mainView.menu.height
}
}
Rectangle {
Layout.fillWidth: false
Layout.preferredWidth: 2
Layout.preferredHeight: parent.height * 2/3
Layout.alignment: Qt.AlignVCenter
color: constants.darkerBackground
}
Item {
visible: !Daemon.currentWallet
Layout.fillWidth: true
}
// Rectangle {
// Layout.fillWidth: false
// Layout.preferredWidth: 2
// Layout.preferredHeight: parent.height * 2/3
// Layout.alignment: Qt.AlignVCenter
// color: constants.darkerBackground
// }
// Item {
// visible: !Daemon.currentWallet
// Layout.fillWidth: true
// }
FlatButton {
visible: Daemon.currentWallet
Layout.fillWidth: true
@ -191,14 +191,14 @@ Item {
dialog.open()
}
}
Rectangle {
visible: Daemon.currentWallet
Layout.fillWidth: false
Layout.preferredWidth: 2
Layout.preferredHeight: parent.height * 2/3
Layout.alignment: Qt.AlignVCenter
color: constants.darkerBackground
}
// Rectangle {
// visible: Daemon.currentWallet
// Layout.fillWidth: false
// Layout.preferredWidth: 2
// Layout.preferredHeight: parent.height * 2/3
// Layout.alignment: Qt.AlignVCenter
// color: constants.darkerBackground
// }
FlatButton {
visible: Daemon.currentWallet
Layout.fillWidth: true

Loading…
Cancel
Save