Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r7a1509a80fed2dd51aa28b460acbf0227d0c96d7 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 7a1509a80fed2dd51aa28b460acbf0227d0c96d7) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file NotificationDialog.qml - * \author (last) Peter Lucia - * \date (last) 06-Oct-2020 - * \author (original) Peter Lucia - * \date (original) 02-Jun-2020 + * \file NotificationDialog.qml + * \author (last) Behrouz NematiPour + * \date (last) 17-Apr-2023 + * \author (original) Peter Lucia + * \date (original) 02-Jun-2020 * */ @@ -28,13 +28,19 @@ contentItem.objectName: "_NotificationDialog" // SquishQt property alias titleText : _title.text + property alias titlePixelSize : _title.font.pixelSize property alias description : _desc.text + property alias descriptionPixelSize : _desc.font.pixelSize property alias titleBarForeground : _title.color property alias titleBarBackground : _titleBar.color property alias isSilenced : _muteButton.isSilenced property alias timeout : _muteButton.timeout property int alarmID : -1 + property alias countDown : _timeoutText.countDown + property alias countDownVisible : _timeoutText.visible + + property bool resumeVisible : false property bool rinsebackVisible : false property bool endVisible : false @@ -52,7 +58,7 @@ // Look for this tag: #First_Time_Message_Sent_With_Silenced // the isSilenced is helping not to show this dialog maximized and // then if the silence is set minimize it immediately - // this behaviour doesn't look nice on the screen and it bounces + // this behaviour does not look nice on the screen and it bounces visible : description && ! isSilenced radius : Variables.dialogRadius @@ -70,26 +76,33 @@ radius : _root.radius clip : true // the mute button expands so we need to clip the outside unwanted area. - Image { id: _icon - source: "qrc:/images/iAlarm" - anchors.horizontalCenter: _title.horizontalCenter - anchors.verticalCenter: _title.verticalCenter - anchors.horizontalCenterOffset: -_title.width + Variables.dialogIconHorizontalOffset; - height : Variables.alarmListIconDiameter - width : Variables.alarmListIconDiameter - } + // Image { id: _icon + // source: "qrc:/images/iAlarm" + // anchors.horizontalCenter: _title.horizontalCenter + // anchors.verticalCenter: _title.verticalCenter + // anchors.horizontalCenterOffset: -_title.width + Variables.dialogIconHorizontalOffset; + // height : Variables.alarmListIconDiameter + // width : Variables.alarmListIconDiameter + // } Text { id: _title color: Colors.textMain font.pixelSize: Fonts.fontPixelTitle text: qsTr("Notification") - anchors.centerIn: _titleBar; + + width: _titleBar.width + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignHCenter + anchors.centerIn: _titleBar } MouseArea { id: _minimizeArea - enabled : _root.minVisible - anchors.fill: parent - onClicked : _root.minimizeClicked() + // this object is not exposed so cannot be missused by the child component, so here it can be enabled and being handled by the minVisible property + // enabled : _root.minVisible + anchors.fill : parent + onClicked : { if ( _root.minVisible ) _root.minimizeClicked() } // if can be minimized (minVisible = true ), call the minimizeClinked signal (norma behavior) + onDoubleClicked : { if ( ! _root.minVisible ) _sdcProgressItem.doubleClicked() } // if can NOT be minimized (minVisible = false), call the sdcard.double click to pop the DiagnosticsDialog + // TODO: disable doubleClicked later. this is only for diagnostic purpose when alarm dialog covers the entire screen. } UpDownButton { id: _minimizeButton @@ -113,22 +126,43 @@ } onClicked: _root.muteClicked() } - // TODO: disable this later. this is only for diagnostic purpose when alarm dialog covers the entire screen. - MouseArea { - anchors.fill: _icon - onClicked : if ( _minimizeArea.enabled ) _root.minimizeClicked() - onDoubleClicked : _sdItem.doubleClicked() + + TimeText { id: _timeoutText + property int countDown : 0 + seconds : countDown * 60 + + height: _titleBar.height + anchors { + verticalCenter : _titleBar.verticalCenter + right : _minimizeButton.left + rightMargin : 15 + } + textPixelSize : 30 + textWeight : Font.Normal + secondsVisible : false + hourZero : false + minuteZero : true } } - Text { id: _desc - objectName: "_NotificationDialog_Description" - color: Colors.textMain - font.pixelSize: Fonts.fontPixelButton + Rectangle { id: _descReect + color: Colors.transparent + clip : true anchors { - horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; + fill : parent + topMargin : _titleBar .height + 2 + bottomMargin : _buttonGroup .height } + + Text { id: _desc + objectName: "_NotificationDialog_Description" + color: Colors.textMain + font.pixelSize: Fonts.fontPixelButton + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter : parent.verticalCenter + } + } } Row { id: _buttonGroup @@ -140,15 +174,15 @@ horizontalCenter: parent.horizontalCenter rightMargin : spacing leftMargin : spacing - bottomMargin : spacing + bottomMargin : spacing / 2 // give the content more space. } // IMPORTANT NOTE : Alarm Dialog buttons // It has been granteed by FW that there should never be more than 3 buttons on the ScreenItem // Regarding the discussion there should be only 3 situations: // 1 - Different combination of the Resume,Rinseback,End // 2 - OK button for user to only ack the alarm - // 3 - No button at all for the situations that the alarm can't be resolved by user. + // 3 - No button at all for the situations that the alarm cannot be resolved by user. // :: OK button and the other 3 buttons (Resume,Rinseback,End) should never come together TouchRect { id : _resumeTouchRect visible : resumeVisible @@ -185,4 +219,16 @@ selectColor : Qt.darker(_root.backgroundColor, 1.15) } } + + Text { id: _alarmID + text : qsTr("ID") + ":" + _root.alarmID + anchors { + left : parent.left + bottom : parent.bottom + leftMargin : 5 + bottomMargin: 5 + } + color : Colors.textMain + font.pixelSize : Fonts.fontPixelDialogText + } }