qml: move remaining buttons to bottom of dialogs
This commit is contained in:
@@ -27,63 +27,67 @@ ElDialog {
|
|||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable {
|
padding: 0
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
contentHeight: rootLayout.height
|
spacing: 0
|
||||||
clip:true
|
|
||||||
interactive: height < contentHeight
|
|
||||||
|
|
||||||
ColumnLayout {
|
Flickable {
|
||||||
id: rootLayout
|
Layout.fillWidth: true
|
||||||
width: parent.width
|
Layout.fillHeight: true
|
||||||
spacing: constants.paddingMedium
|
|
||||||
|
|
||||||
Item {
|
contentHeight: rootLayout.height
|
||||||
Layout.fillWidth: true
|
clip:true
|
||||||
Layout.preferredHeight: qr.height
|
interactive: height < contentHeight
|
||||||
Layout.topMargin: constants.paddingSmall
|
|
||||||
Layout.bottomMargin: constants.paddingSmall
|
|
||||||
QRImage {
|
|
||||||
id: qr
|
|
||||||
qrdata: dialog.text_qr
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
ColumnLayout {
|
||||||
visible: dialog.text_help
|
id: rootLayout
|
||||||
text: dialog.text_help
|
width: parent.width
|
||||||
wrapMode: Text.Wrap
|
spacing: constants.paddingMedium
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
height: 1
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: qr.width
|
Layout.preferredHeight: qr.height
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.topMargin: constants.paddingSmall
|
||||||
color: Material.accentColor
|
Layout.bottomMargin: constants.paddingSmall
|
||||||
}
|
QRImage {
|
||||||
|
id: qr
|
||||||
ButtonContainer {
|
qrdata: dialog.text_qr
|
||||||
// Layout.fillWidth: true
|
anchors.centerIn: parent
|
||||||
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!'))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FlatButton {
|
|
||||||
Layout.minimumWidth: dialog.width * 1/4
|
Label {
|
||||||
text: qsTr('Share')
|
visible: dialog.text_help
|
||||||
icon.source: '../../icons/share.png'
|
text: dialog.text_help
|
||||||
onClicked: {
|
wrapMode: Text.Wrap
|
||||||
AppController.doShare(dialog.text, dialog.title)
|
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"
|
color: "#aa000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable {
|
padding: 0
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
contentHeight: rootLayout.height
|
spacing: 0
|
||||||
clip:true
|
|
||||||
interactive: height < contentHeight
|
|
||||||
|
|
||||||
ColumnLayout {
|
Flickable {
|
||||||
id: rootLayout
|
Layout.fillHeight: true
|
||||||
width: parent.width
|
Layout.fillWidth: true
|
||||||
spacing: constants.paddingMedium
|
|
||||||
|
|
||||||
QRImage {
|
contentHeight: rootLayout.height
|
||||||
id: qr
|
clip:true
|
||||||
render: dialog.enter ? false : true
|
interactive: height < contentHeight
|
||||||
qrdata: dialog.text_qr ? dialog.text_qr : dialog.text
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
ColumnLayout {
|
||||||
Layout.topMargin: constants.paddingSmall
|
id: rootLayout
|
||||||
Layout.bottomMargin: constants.paddingSmall
|
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 {
|
Label {
|
||||||
width: parent.width
|
visible: dialog.text_help
|
||||||
text: dialog.text
|
text: dialog.text_help
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
font.pixelSize: constants.fontSizeLarge
|
Layout.fillWidth: true
|
||||||
font.family: FixedFont
|
|
||||||
maximumLineCount: 4
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
}
|
||||||
visible: dialog.text_help
|
}
|
||||||
text: dialog.text_help
|
|
||||||
wrapMode: Text.Wrap
|
ButtonContainer {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
FlatButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
Layout.preferredWidth: 1
|
||||||
|
|
||||||
Rectangle {
|
text: qsTr('Copy')
|
||||||
height: 1
|
icon.source: '../../icons/copy_bw.png'
|
||||||
Layout.preferredWidth: qr.width
|
onClicked: {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
AppController.textToClipboard(dialog.text)
|
||||||
color: Material.accentColor
|
toaster.show(this, qsTr('Copied!'))
|
||||||
}
|
|
||||||
|
|
||||||
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!'))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
FlatButton {
|
}
|
||||||
Layout.minimumWidth: dialog.width * 1/4
|
FlatButton {
|
||||||
text: qsTr('Share')
|
Layout.fillWidth: true
|
||||||
icon.source: '../../icons/share.png'
|
Layout.preferredWidth: 1
|
||||||
onClicked: {
|
|
||||||
AppController.doShare(dialog.text, dialog.title)
|
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 org.electrum 1.0
|
||||||
|
|
||||||
|
import "controls"
|
||||||
|
|
||||||
ElDialog {
|
ElDialog {
|
||||||
id: dialog
|
id: dialog
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ ElDialog {
|
|||||||
]
|
]
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: qrbg
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: constants.paddingSmall
|
Layout.topMargin: constants.paddingSmall
|
||||||
Layout.bottomMargin: constants.paddingSmall
|
Layout.bottomMargin: constants.paddingSmall
|
||||||
@@ -201,14 +202,13 @@ ElDialog {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
height: 1
|
height: 1
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: buttons.width
|
Layout.preferredWidth: qrbg.width
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
columns: 2
|
columns: 2
|
||||||
// visible: request.message || !request.amount.isEmpty
|
Layout.maximumWidth: qrbg.width
|
||||||
Layout.maximumWidth: buttons.width
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@@ -241,58 +241,64 @@ ElDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
// visible: request.message || !request.amount.isEmpty
|
|
||||||
height: 1
|
height: 1
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.preferredWidth: buttons.width
|
Layout.preferredWidth: qrbg.width
|
||||||
color: Material.accentColor
|
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 {
|
ColumnLayout {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Item {
|
|||||||
function show(item, text) {
|
function show(item, text) {
|
||||||
_text = text
|
_text = text
|
||||||
var r = item.mapToItem(parent, item.x, item.y)
|
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
|
y = r.y - toaster.height - constants.paddingLarge
|
||||||
toaster._y = y - 35
|
toaster._y = y - 35
|
||||||
ani.restart()
|
ani.restart()
|
||||||
|
|||||||
Reference in New Issue
Block a user