Index: sources/gui/qml/components/NotificationBarSmall.qml =================================================================== diff -u -r73b965e55528619f22a12ae3b3408c9dcecc9144 -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision 73b965e55528619f22a12ae3b3408c9dcecc9144) +++ sources/gui/qml/components/NotificationBarSmall.qml (.../NotificationBarSmall.qml) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,14 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * \copyright \n - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n - * IN PART OR IN WHOLE, \n - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n + * 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 NotificationBar.qml - * \date 2020/03/30 - * \author Behrouz NematiPour + * \file NotificationBarSmall.qml + * \author (last) Behrouz NematiPour + * \date (last) 21-Jun-2021 + * \author (original) Peter Lucia + * \date (original) 25-Jun-2020 * */ @@ -17,6 +18,7 @@ // Project import Gui.Actions 0.1 + // Qml imports import "qrc:/globals" @@ -25,19 +27,20 @@ property alias imageSource : _image.source property bool imageAutoSize : false + property bool imageAnimated : false + property alias text : _text.text property alias textColor : _text.color property alias textfontSize : _text.font.pixelSize property alias rowAnchors : _row.anchors property int level : 0 - visible : _text.text height : Variables.notificationHeight color : Colors.textNotificationNoneBg - //radius : Variables.dialogRadius + radius : Variables.dialogRadius anchors { bottom : parent.bottom left : parent.left @@ -48,9 +51,11 @@ anchors.centerIn: parent spacing: 10 Image { id: _image - anchors.verticalCenter: parent.verticalCenter - width : imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconSize - height: imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconSize + width : source == "" ? 0 : imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconDiameter + height: source == "" ? 0 : imageAutoSize ? Math.min(_root.height, _root.width) : Variables.notificationIconDiameter + anchors.verticalCenter : imageAutoSize ? parent.verticalCenter : undefined + anchors.top : imageAutoSize ? undefined : parent.top + anchors.topMargin : height > _root.height ? -((height - _root.height) / 2) : 0 } Text { id: _text color : Colors.textNotificationNoneFg @@ -60,6 +65,19 @@ } } + OpacityAnimator { target: _image + from : 0.3 + to : 1 + duration : 1500 + running : imageAnimated && _root.visible + onFinished : { + var tmp = from + from = to + to = tmp + restart() + } + } + onLevelChanged: { switch (level) { case GuiActions.ALARM_PRIORITY_HIGH: