Index: sources/gui/qml/dialogs/AlarmListDialog.qml =================================================================== diff -u -r1d43ff790e6a3fb03d371bb5bde9c2d432d299b6 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision 1d43ff790e6a3fb03d371bb5bde9c2d432d299b6) +++ sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.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 AlarmListDialog.qml + * \author (last) Behrouz NematiPour + * \date (last) 04-Aug-2021 + * \author (original) Behrouz NematiPour + * \date (original) 10-Dec-2020 * */ @@ -20,6 +20,7 @@ // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! * \brief Contains the Alarm Dialog Implementation @@ -28,18 +29,27 @@ contentItem.objectName: "_NotificationDialog" // SquishQt property alias titleText : _title.text; - property alias description : _desc.text; 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 bool minVisible : true - radius : Variables.dialogRadiusHalf + radius : Variables.dialogRadius signal muteClicked() signal minimizeClicked() + signal itemClicked(int vIndex) + property bool titleFading : false + Fader { + fadingProperyTarget : _root + fadingProperyRunning: titleFading + fadingProperyName : "titleBarBackground" + fadingProperyValue : titleBarBackground + } + Rectangle { id: _titleBar color : Colors.backgroundButtonSelect height : Variables.mainMenuHeight @@ -52,8 +62,8 @@ anchors.horizontalCenter: _title.horizontalCenter anchors.verticalCenter: _title.verticalCenter anchors.horizontalCenterOffset: -_title.width + Variables.dialogIconHorizontalOffset; - height : 45 - width : 45 + height : Variables.alarmListIconDiameter + width : Variables.alarmListIconDiameter } Text { id: _title @@ -64,12 +74,14 @@ } MouseArea { id: _minimizeArea + enabled : _root.minVisible anchors.fill: parent onClicked : _root.minimizeClicked() } UpDownButton { - isUp: false + isUp : false + isList : ! _root.minVisible anchors { verticalCenter : _titleBar.verticalCenter right : _titleBar.right @@ -89,6 +101,8 @@ } Text { id: _desc + visible : ! vAlarmActiveList.adjustment_Accepted + text : vAlarmActiveList.status objectName: "_NotificationDialog_Description" color: Colors.textMain font.pixelSize: Fonts.fontPixelButton @@ -97,4 +111,46 @@ verticalCenter: parent.verticalCenter; } } + + ScrollBar { + visible : vAlarmActiveList.adjustment_Accepted && ( flickable.height < flickable.contentHeight ) + anchors.fill: _flickable + flickable : _flickable + backColor : Colors.backgroundDialog + } + + Flickable { id : _flickable + clip : true + visible : vAlarmActiveList.adjustment_Accepted + anchors { + top : _titleBar.bottom + topMargin : Variables.minVGap + bottom : _root.bottom + bottomMargin : Variables.mainMenuHeight + Variables.minVGap + horizontalCenter: parent.horizontalCenter + } + width : Variables.dialogWidth - Variables.minVGap * 2 // * 2 : for each side + height : Variables.dialogHeight - Variables.minVGap * 2 - _titleBar.height // * 2 : for each side + contentWidth : width + contentHeight: _alarmGrid.height + + TouchGrid { id: _alarmGrid + alignCenter : false + height : rowCount * ( rowSpacing + itemHeight ) + width : parent.width + colCount : 1 + rowCount : vAlarmActiveList.alarmIDs.length + itemHeight : 80 + itemWidth : Variables.dialogWidth - Variables.minVGap * (2 + 1) // * 2 : for each side & the +1 to not cover the scrollbar + rowSpacing : 0 + colSpacing : 0 + lineColor : Colors.backgroundMain + itemsText : vAlarmActiveList.alarmIDs + itemsValue : vAlarmActiveList.alarmTexts + itemsTouchable : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] + itemsValueLeftMargin : 80 // if decreased maybe covered by title + itemsUnitLeftMargin : 470 // if increased will be covered by chevron if touchable + onItemClicked : _root.itemClicked(vIndex) + } + } }