1
0

qml: unify dialog headers

This commit is contained in:
Sander van Grieken
2022-09-30 14:37:14 +02:00
parent e73993dba5
commit 68b630a2e9
6 changed files with 56 additions and 125 deletions

View File

@@ -6,6 +6,7 @@ Dialog {
id: abstractdialog
property bool allowClose: true
property string iconSource
onOpenedChanged: {
if (opened) {
@@ -14,4 +15,42 @@ Dialog {
app.activeDialogs.pop()
}
}
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)
}
}
}