47 lines
1.1 KiB
QML
47 lines
1.1 KiB
QML
import qs
|
|
import qs.common
|
|
import qs.common.widgets
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
Item {
|
|
id: root
|
|
|
|
height: parent.height
|
|
implicitWidth: rowLayout.implicitWidth
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
acceptedButtons: Qt.LeftButton
|
|
onPressed: (event) => {
|
|
GlobalStates.notificationPanelOpen = !GlobalStates.notificationPanelOpen && NotificationService.amountNotifications > 0;
|
|
}
|
|
}
|
|
|
|
RowLayout {
|
|
id: rowLayout
|
|
|
|
anchors.fill: parent
|
|
//spacing: 15
|
|
|
|
StyledText {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
font.pixelSize: Appearance.font.pixelSize.larger
|
|
color: Appearance.m3colors.m3error
|
|
text: "" + NotificationService.amountNotifications
|
|
visible: {
|
|
NotificationService.amountNotifications > 0
|
|
}
|
|
}
|
|
|
|
MaterialSymbol {
|
|
Layout.alignment: Qt.AlignVCenter
|
|
visible: true
|
|
fill: 1
|
|
text: NotificationService.amountNotifications > 0 ? "notifications_unread" : "notifications"
|
|
iconSize: Appearance.font.pixelSize.larger
|
|
color: NotificationService.amountNotifications > 0 ? Appearance.m3colors.m3error : Appearance.m3colors.m3onSecondaryContainer
|
|
}
|
|
}
|
|
}
|