Browse Source

qml: create ScanDialog

master
Sander van Grieken 3 years ago
parent
commit
959d481e93
  1. 45
      electrum/gui/qml/components/ScanDialog.qml
  2. 8
      electrum/gui/qml/components/main.qml

45
electrum/gui/qml/components/ScanDialog.qml

@ -0,0 +1,45 @@
import QtQuick 2.6
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import "controls"
ElDialog {
id: scanDialog
property string scanData
property string error
property string hint
signal found
width: parent.width
height: parent.height
padding: 0
header: null
topPadding: 0 // dialog needs topPadding override
ColumnLayout {
anchors.fill: parent
spacing: 0
QRScan {
Layout.fillWidth: true
Layout.fillHeight: true
hint: scanDialog.hint
onFound: {
scanDialog.scanData = scanData
scanDialog.found()
}
}
FlatButton {
id: button
Layout.fillWidth: true
text: qsTr('Cancel')
icon.source: '../../icons/closebutton.png'
onClicked: doReject()
}
}
}

8
electrum/gui/qml/components/main.qml

@ -361,6 +361,14 @@ ApplicationWindow
} }
} }
property alias scanDialog: _scanDialog
Component {
id: _scanDialog
ScanDialog {
onClosed: destroy()
}
}
property alias channelOpenProgressDialog: _channelOpenProgressDialog property alias channelOpenProgressDialog: _channelOpenProgressDialog
ChannelOpenProgressDialog { ChannelOpenProgressDialog {
id: _channelOpenProgressDialog id: _channelOpenProgressDialog

Loading…
Cancel
Save