qml: move remaining buttons to bottom of dialogs
This commit is contained in:
@@ -27,63 +27,67 @@ ElDialog {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
Flickable {
|
||||
padding: 0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
contentHeight: rootLayout.height
|
||||
clip:true
|
||||
interactive: height < contentHeight
|
||||
spacing: 0
|
||||
|
||||
ColumnLayout {
|
||||
id: rootLayout
|
||||
width: parent.width
|
||||
spacing: constants.paddingMedium
|
||||
Flickable {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: qr.height
|
||||
Layout.topMargin: constants.paddingSmall
|
||||
Layout.bottomMargin: constants.paddingSmall
|
||||
QRImage {
|
||||
id: qr
|
||||
qrdata: dialog.text_qr
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
contentHeight: rootLayout.height
|
||||
clip:true
|
||||
interactive: height < contentHeight
|
||||
|
||||
Label {
|
||||
visible: dialog.text_help
|
||||
text: dialog.text_help
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
ColumnLayout {
|
||||
id: rootLayout
|
||||
width: parent.width
|
||||
spacing: constants.paddingMedium
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.preferredWidth: qr.width
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
ButtonContainer {
|
||||
// Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
text: qsTr('Copy')
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
onClicked: {
|
||||
AppController.textToClipboard(dialog.text)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: qr.height
|
||||
Layout.topMargin: constants.paddingSmall
|
||||
Layout.bottomMargin: constants.paddingSmall
|
||||
QRImage {
|
||||
id: qr
|
||||
qrdata: dialog.text_qr
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
text: qsTr('Share')
|
||||
icon.source: '../../icons/share.png'
|
||||
onClicked: {
|
||||
AppController.doShare(dialog.text, dialog.title)
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: dialog.text_help
|
||||
text: dialog.text_help
|
||||
wrapMode: Text.Wrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ButtonContainer {
|
||||
Layout.fillWidth: true
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Copy')
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
onClicked: {
|
||||
AppController.textToClipboard(dialog.text)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Share')
|
||||
icon.source: '../../icons/share.png'
|
||||
onClicked: {
|
||||
AppController.doShare(dialog.text, dialog.title)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,72 +25,81 @@ ElDialog {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
Flickable {
|
||||
padding: 0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
contentHeight: rootLayout.height
|
||||
clip:true
|
||||
interactive: height < contentHeight
|
||||
spacing: 0
|
||||
|
||||
ColumnLayout {
|
||||
id: rootLayout
|
||||
width: parent.width
|
||||
spacing: constants.paddingMedium
|
||||
Flickable {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
QRImage {
|
||||
id: qr
|
||||
render: dialog.enter ? false : true
|
||||
qrdata: dialog.text_qr ? dialog.text_qr : dialog.text
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: constants.paddingSmall
|
||||
Layout.bottomMargin: constants.paddingSmall
|
||||
}
|
||||
contentHeight: rootLayout.height
|
||||
clip:true
|
||||
interactive: height < contentHeight
|
||||
|
||||
ColumnLayout {
|
||||
id: rootLayout
|
||||
width: parent.width
|
||||
spacing: constants.paddingMedium
|
||||
|
||||
QRImage {
|
||||
id: qr
|
||||
render: dialog.enter ? false : true
|
||||
qrdata: dialog.text_qr ? dialog.text_qr : dialog.text
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: constants.paddingSmall
|
||||
Layout.bottomMargin: constants.paddingSmall
|
||||
}
|
||||
|
||||
TextHighlightPane {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: qr.width
|
||||
Label {
|
||||
width: parent.width
|
||||
text: dialog.text
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: constants.fontSizeLarge
|
||||
font.family: FixedFont
|
||||
maximumLineCount: 4
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
TextHighlightPane {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
width: parent.width
|
||||
text: dialog.text
|
||||
visible: dialog.text_help
|
||||
text: dialog.text_help
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: constants.fontSizeLarge
|
||||
font.family: FixedFont
|
||||
maximumLineCount: 4
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: dialog.text_help
|
||||
text: dialog.text_help
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
|
||||
ButtonContainer {
|
||||
Layout.fillWidth: true
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.preferredWidth: qr.width
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
ButtonContainer {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
text: qsTr('Copy')
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
onClicked: {
|
||||
AppController.textToClipboard(dialog.text)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
}
|
||||
text: qsTr('Copy')
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
onClicked: {
|
||||
AppController.textToClipboard(dialog.text)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
}
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
text: qsTr('Share')
|
||||
icon.source: '../../icons/share.png'
|
||||
onClicked: {
|
||||
AppController.doShare(dialog.text, dialog.title)
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
text: qsTr('Share')
|
||||
icon.source: '../../icons/share.png'
|
||||
onClicked: {
|
||||
AppController.doShare(dialog.text, dialog.title)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import QtQuick.Controls.Material 2.0
|
||||
|
||||
import org.electrum 1.0
|
||||
|
||||
import "controls"
|
||||
|
||||
ElDialog {
|
||||
id: dialog
|
||||
|
||||
|
||||
@@ -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,58 +241,64 @@ 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
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
icon.color: 'transparent'
|
||||
text: 'Copy'
|
||||
onClicked: {
|
||||
if (request.isLightning && rootLayout.state == 'bolt11')
|
||||
AppController.textToClipboard(_bolt11)
|
||||
else if (rootLayout.state == 'bip21uri')
|
||||
AppController.textToClipboard(_bip21uri)
|
||||
else
|
||||
AppController.textToClipboard(_address)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
icon.source: '../../icons/share.png'
|
||||
text: 'Share'
|
||||
onClicked: {
|
||||
enabled = false
|
||||
if (request.isLightning && rootLayout.state == 'bolt11')
|
||||
AppController.doShare(_bolt11, qsTr('Payment Request'))
|
||||
else if (rootLayout.state == 'bip21uri')
|
||||
AppController.doShare(_bip21uri, qsTr('Payment Request'))
|
||||
else
|
||||
AppController.doShare(_address, qsTr('Onchain address'))
|
||||
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.minimumWidth: dialog.width * 1/4
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
icon.source: '../../icons/pen.png'
|
||||
text: qsTr('Edit')
|
||||
onClicked: receiveDetailsDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ButtonContainer {
|
||||
id: buttons
|
||||
Layout.fillWidth: true
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
icon.color: 'transparent'
|
||||
text: 'Copy'
|
||||
onClicked: {
|
||||
if (request.isLightning && rootLayout.state == 'bolt11')
|
||||
AppController.textToClipboard(_bolt11)
|
||||
else if (rootLayout.state == 'bip21uri')
|
||||
AppController.textToClipboard(_bip21uri)
|
||||
else
|
||||
AppController.textToClipboard(_address)
|
||||
toaster.show(this, qsTr('Copied!'))
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
icon.source: '../../icons/share.png'
|
||||
text: 'Share'
|
||||
onClicked: {
|
||||
enabled = false
|
||||
if (request.isLightning && rootLayout.state == 'bolt11')
|
||||
AppController.doShare(_bolt11, qsTr('Payment Request'))
|
||||
else if (rootLayout.state == 'bip21uri')
|
||||
AppController.doShare(_bip21uri, qsTr('Payment Request'))
|
||||
else
|
||||
AppController.doShare(_address, qsTr('Onchain address'))
|
||||
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
|
||||
icon.source: '../../icons/pen.png'
|
||||
text: qsTr('Edit')
|
||||
onClicked: receiveDetailsDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user