qml: abstract ElDialog resize behavior to property
This commit is contained in:
@@ -13,7 +13,7 @@ ElDialog {
|
|||||||
title: qsTr('Loading Wallet')
|
title: qsTr('Loading Wallet')
|
||||||
iconSource: Qt.resolvedUrl('../../icons/wallet.png')
|
iconSource: Qt.resolvedUrl('../../icons/wallet.png')
|
||||||
|
|
||||||
parent: Overlay.overlay
|
resizeWithKeyboard: false
|
||||||
|
|
||||||
x: Math.floor((parent.width - implicitWidth) / 2)
|
x: Math.floor((parent.width - implicitWidth) / 2)
|
||||||
y: Math.floor((parent.height - implicitHeight) / 2)
|
y: Math.floor((parent.height - implicitHeight) / 2)
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ Dialog {
|
|||||||
|
|
||||||
property bool allowClose: true
|
property bool allowClose: true
|
||||||
property string iconSource
|
property string iconSource
|
||||||
|
property bool resizeWithKeyboard: true
|
||||||
|
|
||||||
function doClose() {
|
function doClose() {
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|
||||||
parent: Overlay.overlay.children[0]
|
parent: resizeWithKeyboard ? Overlay.overlay.children[0] : Overlay.overlay
|
||||||
modal: true
|
modal: true
|
||||||
Overlay.modal: Rectangle {
|
Overlay.modal: Rectangle {
|
||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ ApplicationWindow
|
|||||||
Item {
|
Item {
|
||||||
// Item as first child in Overlay that adjusts its size to the available
|
// Item as first child in Overlay that adjusts its size to the available
|
||||||
// screen space minus the virtual keyboard (e.g. to center dialogs in)
|
// screen space minus the virtual keyboard (e.g. to center dialogs in)
|
||||||
|
// see ElDialog.resizeWithKeyboard property
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: inputPanel.y
|
height: inputPanel.y
|
||||||
|
|||||||
Reference in New Issue
Block a user