Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -r923377d29fe730c0e2209386479a61b1e8ee1097 -r140ba1261d1ec2c20fa44be3a97174dd841aa71a --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 923377d29fe730c0e2209386479a61b1e8ee1097) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 140ba1261d1ec2c20fa44be3a97174dd841aa71a) @@ -16,6 +16,7 @@ // Qt import QtQuick 2.12 import QtQuick.Controls 2.12 // Dialog +import QtGraphicalEffects 1.12 // Project // Qml imports @@ -35,12 +36,16 @@ property alias radius : _backgroundRect.radius property alias notificationText : _notification.text property alias notification : _notification + property bool showDropShadow : false + property alias backgroundItem : _backgroundItem.children + property alias backgroundItemZ : _backgroundItem.z width : Variables.dialogWidth height : Variables.dialogHeight visible : false - anchors.centerIn: parent + x: Math.round((Variables.applicationWidth - width) / 2) + y: Math.round((Variables.applicationHeight - height) / 2) enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200 } } exit : Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200 } } @@ -49,16 +54,31 @@ closePolicy: Dialog.NoAutoClose Overlay.modal : Rectangle { id : _borderRect - anchors.fill : parent - anchors.bottomMargin: _alarmBar.visible ? Variables.notificationHeight : 0 - color : "#B3000000" + anchors.fill : parent + anchors.bottomMargin: _alarmBar.visible ? Variables.notificationHeight : 0 + color : "#99000000" Behavior on opacity { NumberAnimation { duration: 300} } } background: Rectangle { id: _backgroundRect - color : Colors.backgroundDialog - radius: Variables.dialogRadius + color : Colors.backgroundDialog + radius : Variables.dialogRadius + + layer.enabled : showDropShadow + layer.effect: DropShadow { + id: _dropShadow + horizontalOffset: 4 + verticalOffset : 4 + radius : 12 + samples : 32 + color : Colors.dropShadowDialogColor + source : _backgroundRect + anchors.fill : _backgroundRect + } + + // 👇 Placeholder for an injected component. Ex. numpad + Item { id: _backgroundItem } } onVisibleChanged: { @@ -78,5 +98,5 @@ } } - NotificationBarSmall { id: _notification } + NotificationBarSmall { id: _notification ; height: 60} }