Browse Source

qml: move remaining buttons to bottom of dialogs

master
Sander van Grieken 3 years ago
parent
commit
9d425b5b23
  1. 26
      electrum/gui/qml/components/ExportTxDialog.qml
  2. 29
      electrum/gui/qml/components/GenericShareDialog.qml
  3. 2
      electrum/gui/qml/components/LoadingWalletDialog.qml
  4. 32
      electrum/gui/qml/components/ReceiveDialog.qml
  5. 2
      electrum/gui/qml/components/controls/Toaster.qml

26
electrum/gui/qml/components/ExportTxDialog.qml

@ -27,8 +27,16 @@ ElDialog {
color: "#aa000000"
}
Flickable {
padding: 0
ColumnLayout {
anchors.fill: parent
spacing: 0
Flickable {
Layout.fillWidth: true
Layout.fillHeight: true
contentHeight: rootLayout.height
clip:true
interactive: height < contentHeight
@ -57,19 +65,15 @@ ElDialog {
Layout.fillWidth: true
}
Rectangle {
height: 1
Layout.preferredWidth: qr.width
Layout.alignment: Qt.AlignHCenter
color: Material.accentColor
}
}
ButtonContainer {
// Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Copy')
icon.source: '../../icons/copy_bw.png'
onClicked: {
@ -78,7 +82,8 @@ ElDialog {
}
}
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Share')
icon.source: '../../icons/share.png'
onClicked: {
@ -87,7 +92,6 @@ ElDialog {
}
}
}
}
Toaster {
id: toaster

29
electrum/gui/qml/components/GenericShareDialog.qml

@ -25,8 +25,16 @@ ElDialog {
color: "#aa000000"
}
Flickable {
padding: 0
ColumnLayout {
anchors.fill: parent
spacing: 0
Flickable {
Layout.fillHeight: true
Layout.fillWidth: true
contentHeight: rootLayout.height
clip:true
interactive: height < contentHeight
@ -46,7 +54,9 @@ ElDialog {
}
TextHighlightPane {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.maximumWidth: qr.width
Label {
width: parent.width
text: dialog.text
@ -65,18 +75,16 @@ ElDialog {
Layout.fillWidth: true
}
Rectangle {
height: 1
Layout.preferredWidth: qr.width
Layout.alignment: Qt.AlignHCenter
color: Material.accentColor
}
}
ButtonContainer {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Copy')
icon.source: '../../icons/copy_bw.png'
onClicked: {
@ -85,7 +93,9 @@ ElDialog {
}
}
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
text: qsTr('Share')
icon.source: '../../icons/share.png'
onClicked: {
@ -94,7 +104,6 @@ ElDialog {
}
}
}
}
Connections {
target: dialog.enter

2
electrum/gui/qml/components/LoadingWalletDialog.qml

@ -5,6 +5,8 @@ import QtQuick.Controls.Material 2.0
import org.electrum 1.0
import "controls"
ElDialog {
id: dialog

32
electrum/gui/qml/components/ReceiveDialog.qml

@ -73,6 +73,7 @@ ElDialog {
]
Rectangle {
id: qrbg
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: constants.paddingSmall
Layout.bottomMargin: constants.paddingSmall
@ -201,14 +202,13 @@ ElDialog {
Rectangle {
height: 1
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: buttons.width
Layout.preferredWidth: qrbg.width
color: Material.accentColor
}
GridLayout {
columns: 2
// visible: request.message || !request.amount.isEmpty
Layout.maximumWidth: buttons.width
Layout.maximumWidth: qrbg.width
Layout.alignment: Qt.AlignHCenter
Label {
@ -241,18 +241,24 @@ ElDialog {
}
Rectangle {
// visible: request.message || !request.amount.isEmpty
height: 1
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: buttons.width
Layout.preferredWidth: qrbg.width
color: Material.accentColor
}
}
}
ButtonContainer {
id: buttons
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
icon.source: '../../icons/copy_bw.png'
icon.color: 'transparent'
text: 'Copy'
@ -267,7 +273,9 @@ ElDialog {
}
}
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.fillWidth: true
Layout.preferredWidth: 1
icon.source: '../../icons/share.png'
text: 'Share'
onClicked: {
@ -283,8 +291,9 @@ ElDialog {
}
}
FlatButton {
Layout.minimumWidth: dialog.width * 1/4
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.preferredWidth: 1
icon.source: '../../icons/pen.png'
text: qsTr('Edit')
onClicked: receiveDetailsDialog.open()
@ -292,9 +301,6 @@ ElDialog {
}
}
}
}
ColumnLayout {
visible: _ispaid
anchors.centerIn: parent

2
electrum/gui/qml/components/controls/Toaster.qml

@ -17,7 +17,7 @@ Item {
function show(item, text) {
_text = text
var r = item.mapToItem(parent, item.x, item.y)
x = r.x
x = r.x - (toaster.width - item.width)/2
y = r.y - toaster.height - constants.paddingLarge
toaster._y = y - 35
ani.restart()

Loading…
Cancel
Save