linphone-desktop/Linphone/view/Control/Display/UnreadNotification.qml
Gaelle Braud f1ee81e095 add unread notification count on class window chat button #LINQT-2138
reset last active window if destroyed
2025-11-21 15:55:32 +01:00

42 lines
No EOL
1.2 KiB
QML

import QtQuick
import Linphone
import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.Control {
id: mainItem
property int unread: 0
width: Utils.getSizeWithScreenRatio(14)
height: Utils.getSizeWithScreenRatio(14)
visible: unread > 0
background: Item {
anchors.fill: parent
Rectangle {
id: background
anchors.fill: parent
radius: width/2
color: DefaultStyle.danger_500_main
}
MultiEffect {
id: shadow
anchors.fill: background
source: background
// Crash : https://bugreports.qt.io/browse/QTBUG-124730?
shadowEnabled: true
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: 0.15
z: mainItem.z - 1
}
}
contentItem: Text {
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
color: DefaultStyle.grey_0
fontSizeMode: Text.Fit
font.pixelSize: Utils.getSizeWithScreenRatio(10)
text: mainItem.unread > 100 ? '99+' : mainItem.unread
}
}