2022-07-26 16:20:17 +02:00
|
|
|
import QtQuick 2.6
|
|
|
|
|
import QtQuick.Layouts 1.0
|
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
|
id: abstractdialog
|
|
|
|
|
|
|
|
|
|
property bool allowClose: true
|
2022-09-30 14:37:14 +02:00
|
|
|
property string iconSource
|
2022-07-26 16:20:17 +02:00
|
|
|
|
2022-11-16 12:12:43 +01:00
|
|
|
function doClose() {
|
|
|
|
|
close()
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-26 16:20:17 +02:00
|
|
|
onOpenedChanged: {
|
|
|
|
|
if (opened) {
|
2022-09-26 13:55:54 +02:00
|
|
|
app.activeDialogs.push(abstractdialog)
|
2022-07-26 16:20:17 +02:00
|
|
|
} else {
|
2023-02-06 12:43:54 +01:00
|
|
|
if (app.activeDialogs.indexOf(abstractdialog) < 0) {
|
|
|
|
|
console.log('dialog should exist in activeDialogs!')
|
|
|
|
|
app.activeDialogs.pop()
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
app.activeDialogs.splice(app.activeDialogs.indexOf(abstractdialog),1)
|
2022-07-26 16:20:17 +02:00
|
|
|
}
|
|
|
|
|
}
|
2022-09-30 14:37:14 +02:00
|
|
|
|
|
|
|
|
header: ColumnLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
visible: iconSource
|
|
|
|
|
source: iconSource
|
|
|
|
|
Layout.preferredWidth: constants.iconSizeXLarge
|
|
|
|
|
Layout.preferredHeight: constants.iconSizeXLarge
|
|
|
|
|
Layout.leftMargin: constants.paddingMedium
|
|
|
|
|
Layout.topMargin: constants.paddingMedium
|
|
|
|
|
Layout.bottomMargin: constants.paddingMedium
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: title
|
|
|
|
|
elide: Label.ElideRight
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
leftPadding: constants.paddingXLarge
|
|
|
|
|
topPadding: constants.paddingXLarge
|
|
|
|
|
bottomPadding: constants.paddingXLarge
|
|
|
|
|
font.bold: true
|
|
|
|
|
font.pixelSize: constants.fontSizeMedium
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: constants.paddingXXSmall
|
|
|
|
|
Layout.rightMargin: constants.paddingXXSmall
|
|
|
|
|
height: 1
|
|
|
|
|
color: Qt.rgba(0,0,0,0.5)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-26 16:20:17 +02:00
|
|
|
}
|