qml: wallet loading indicator as modal dialog, unclosable
This commit is contained in:
41
electrum/gui/qml/components/LoadingWalletDialog.qml
Normal file
41
electrum/gui/qml/components/LoadingWalletDialog.qml
Normal file
@@ -0,0 +1,41 @@
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Material 2.0
|
||||
|
||||
import org.electrum 1.0
|
||||
|
||||
ElDialog {
|
||||
id: dialog
|
||||
|
||||
title: qsTr('Loading Wallet')
|
||||
iconSource: Qt.resolvedUrl('../../icons/wallet.png')
|
||||
|
||||
modal: true
|
||||
parent: Overlay.overlay
|
||||
Overlay.modal: Rectangle {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
x: Math.floor((parent.width - implicitWidth) / 2)
|
||||
y: Math.floor((parent.height - implicitHeight) / 2)
|
||||
// anchors.centerIn: parent // this strangely pixelates the spinner
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
|
||||
BusyIndicator {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
running: Daemon.loading
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Daemon
|
||||
function onLoadingChanged() {
|
||||
if (!Daemon.loading)
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user