2023-07-17 10:49:06 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Controls.Material
|
2022-10-27 23:12:39 +02:00
|
|
|
|
|
|
|
|
import "controls"
|
|
|
|
|
|
|
|
|
|
ElDialog {
|
|
|
|
|
id: dialog
|
|
|
|
|
|
2023-03-30 12:26:28 +02:00
|
|
|
required property string text
|
2022-10-27 23:12:39 +02:00
|
|
|
property string text_qr
|
|
|
|
|
// if text_qr is undefined text will be used
|
|
|
|
|
property string text_help
|
2023-03-31 10:49:36 +02:00
|
|
|
property string text_warn
|
2022-10-27 23:12:39 +02:00
|
|
|
|
2023-03-09 15:19:33 +01:00
|
|
|
title: qsTr('Share Transaction')
|
2022-10-27 23:12:39 +02:00
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
2023-02-23 20:57:45 +01:00
|
|
|
padding: 0
|
2022-10-27 23:12:39 +02:00
|
|
|
|
2023-02-23 20:57:45 +01:00
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
Flickable {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
|
|
contentHeight: rootLayout.height
|
|
|
|
|
clip:true
|
|
|
|
|
interactive: height < contentHeight
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
id: rootLayout
|
|
|
|
|
width: parent.width
|
|
|
|
|
spacing: constants.paddingMedium
|
|
|
|
|
|
2023-11-13 11:37:05 +01:00
|
|
|
TextHighlightPane {
|
2023-02-23 20:57:45 +01:00
|
|
|
Layout.fillWidth: true
|
2023-11-13 11:37:05 +01:00
|
|
|
Layout.leftMargin: constants.paddingMedium
|
|
|
|
|
Layout.rightMargin: constants.paddingMedium
|
|
|
|
|
padding: constants.paddingMedium
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
width: parent.width
|
|
|
|
|
QRImage {
|
|
|
|
|
id: qr
|
|
|
|
|
qrdata: dialog.text_qr
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.topMargin: constants.paddingMedium
|
|
|
|
|
Layout.bottomMargin: constants.paddingMedium
|
|
|
|
|
}
|
2023-02-23 20:57:45 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-10-27 23:12:39 +02:00
|
|
|
|
2023-03-29 11:39:40 +02:00
|
|
|
InfoTextArea {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.margins: constants.paddingLarge
|
2023-02-23 20:57:45 +01:00
|
|
|
visible: dialog.text_help
|
|
|
|
|
text: dialog.text_help
|
2022-10-27 23:12:39 +02:00
|
|
|
}
|
2023-03-31 10:49:36 +02:00
|
|
|
|
|
|
|
|
InfoTextArea {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.margins: constants.paddingLarge
|
|
|
|
|
Layout.topMargin: dialog.text_help
|
|
|
|
|
? 0
|
|
|
|
|
: constants.paddingLarge
|
|
|
|
|
visible: dialog.text_warn
|
|
|
|
|
text: dialog.text_warn
|
|
|
|
|
iconStyle: InfoTextArea.IconStyle.Warn
|
|
|
|
|
}
|
2022-10-27 23:12:39 +02:00
|
|
|
}
|
2023-02-23 20:57:45 +01:00
|
|
|
}
|
2022-10-27 23:12:39 +02:00
|
|
|
|
2023-02-23 20:57:45 +01:00
|
|
|
ButtonContainer {
|
|
|
|
|
Layout.fillWidth: true
|
2022-10-27 23:12:39 +02:00
|
|
|
|
2023-02-23 20:57:45 +01:00
|
|
|
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!'))
|
2022-10-27 23:12:39 +02:00
|
|
|
}
|
2023-02-23 20:57:45 +01:00
|
|
|
}
|
|
|
|
|
FlatButton {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.preferredWidth: 1
|
|
|
|
|
text: qsTr('Share')
|
|
|
|
|
icon.source: '../../icons/share.png'
|
|
|
|
|
onClicked: {
|
|
|
|
|
AppController.doShare(dialog.text, dialog.title)
|
2022-10-27 23:12:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-31 15:05:18 +01:00
|
|
|
Toaster {
|
|
|
|
|
id: toaster
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 23:12:39 +02:00
|
|
|
Connections {
|
|
|
|
|
target: dialog.enter
|
|
|
|
|
function onRunningChanged() {
|
|
|
|
|
if (!dialog.enter.running) {
|
|
|
|
|
qr.render = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|