linphone-desktop/tests/ui/components/dialog/DialogPlus.qml
2016-09-13 11:46:27 +02:00

51 lines
1.3 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
// ===================================================================
// Helper to build quickly dialogs.
// ===================================================================
Window {
default property alias contents: content.data // Required.
property alias buttons: buttons.data // Required.
property alias descriptionText: description.text // Optionnal.
property bool centeredButtons // Optionnal.
modality: Qt.WindowModal
ColumnLayout {
anchors.fill: parent
spacing: 0
// Description.
DialogDescription {
Layout.fillWidth: true
id: description
}
// Content.
Item {
Layout.fillHeight: true
Layout.fillWidth: true
id: content
}
// Buttons.
Item {
Layout.fillWidth: true
height: 60
Row {
anchors.left: (!centeredButtons && parent.left) || undefined
anchors.horizontalCenter: parent.horizontalCenter
anchors.leftMargin: 50
anchors.verticalCenter: parent.verticalCenter
height: 30
id: buttons
spacing: 20
}
}
}
}