Files
z-bar-qt/Modules/NotifBell.qml
T

47 lines
1.2 KiB
QML

import Quickshell
import QtQuick
import qs.Config
import qs.Daemons
import qs.Components
CustomRect {
id: root
required property bool horizontal
required property Wrapper popouts
required property PersistentProperties visibilities
anchors.fill: parent
color: visibilities.sidebar ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: horizontal ? Config.bar.height + Appearance.padding.smallest * 2 : width
implicitWidth: horizontal ? height : Config.bar.height + Appearance.padding.smallest * 2
radius: Appearance.rounding.full
MaterialIcon {
id: notificationCenterIcon
anchors.centerIn: parent
color: root.visibilities.sidebar ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
fill: root.visibilities.sidebar ? 1 : 0
font.pointSize: root.horizontal ? Appearance.font.size.larger : Appearance.font.size.large
text: NotifServer.list.length ? "\uf4fe" : "\ue7f4"
Behavior on color {
CAnim {
}
}
Behavior on fill {
Anim {
}
}
}
StateLayer {
color: root.visibilities.sidebar ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
onClicked: {
root.visibilities.sidebar = !root.visibilities.sidebar;
}
}
}