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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save