linphone-desktop/linphone-app/ui/modules/Common/Dialog/DialogPlus.qml
Julien Wadel 66d5bbc100 Add a confirm popup for meeting deletion.
Change date and time pickers into datetime popup.
Upgrade date picker design.
Fix time picker design to follow popup layout.
Fix audio video conference URI migration in linphonerc and avoid to replace it if it already exists (same for conference URI).
Remove binding loop warning on combobox.
In meeting creation, format dates to system and fix combobox display.
2022-07-15 17:04:40 +02:00

114 lines
3.3 KiB
QML

import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Common.Styles 1.0
// =============================================================================
// Helper to build quickly dialogs.
// =============================================================================
Rectangle {
id: dialog
property alias buttons: buttons.data // Optionnal.
property alias title : titleBar.text //Optionnal. Show a title bar with a close button.
property alias descriptionText: description.text // Optionnal.
property int buttonsAlignment : Qt.AlignLeft
property bool flat : false
property bool showMargins: !flat
property bool expandHeight: flat
property alias showCloseCross : titleBar.showCloseCross
property alias showTitleBar: titleBar.showBar
property int buttonsLeftMargin :(buttonsAlignment & Qt.AlignLeft )== Qt.AlignLeft
? DialogStyle.buttons.leftMargin
: (buttonsAlignment & Qt.AlignRight) == Qt.AlignRight
? DialogStyle.buttons.rightMargin
: DialogStyle.buttons.leftMargin
property int buttonsRightMargin : (buttonsAlignment & Qt.AlignRight )== Qt.AlignRight
? DialogStyle.buttons.rightMargin
: (buttonsAlignment & Qt.AlignLeft) == Qt.AlignLeft
? DialogStyle.buttons.leftMargin
: DialogStyle.buttons.rightMargin
default property alias _content: content.data
readonly property bool contentIsEmpty: {
return _content == null || !_content.length
}
// ---------------------------------------------------------------------------
signal exitStatus (var status)
// ---------------------------------------------------------------------------
function exit (status) {
exitStatus(status)
}
// ---------------------------------------------------------------------------
color: DialogStyle.color
layer {
enabled: !dialog.flat
effect: PopupShadow {}
}
// ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: exit(0)
}
// ---------------------------------------------------------------------------
ColumnLayout {
anchors.fill: parent
spacing: 0
DialogTitle{
id:titleBar
//Layout.fillHeight: dialog.contentIsEmpty
flat: dialog.flat
showCloseCross:dialog.showCloseCross
Layout.fillWidth: true
onClose: exitStatus(0)
}
DialogDescription {
id: description
Layout.fillHeight: dialog.contentIsEmpty
Layout.fillWidth: true
visible: text!=''
}
Item {
id: content
Layout.fillHeight: (expandHeight ? true : !dialog.contentIsEmpty)
Layout.fillWidth: true
Layout.topMargin: (showMargins ? titleBar.showBar ? 1 : 2 : 0) * DialogStyle.content.topMargin
Layout.bottomMargin: (showMargins ? DialogStyle.content.bottomMargin : 0)
Layout.leftMargin: (showMargins ? DialogStyle.content.leftMargin : 0)
Layout.rightMargin: (showMargins ? DialogStyle.content.rightMargin : 0)
}
RowLayout {
id: buttons
Layout.alignment: buttonsAlignment
Layout.bottomMargin: DialogStyle.buttons.bottomMargin
Layout.leftMargin: buttonsLeftMargin
Layout.rightMargin: buttonsRightMargin
Layout.topMargin: DialogStyle.buttons.topMargin
spacing: DialogStyle.buttons.spacing
visible: children.length>0
}
}
}