refactor: unified BarModule base component, click-to-open panels, remove pinning
This commit is contained in:
parent
034f0b6d85
commit
26476dc930
33 changed files with 273 additions and 517 deletions
|
|
@ -5,10 +5,10 @@ import "." as M
|
|||
import "../services" as S
|
||||
import "../applets" as C
|
||||
|
||||
M.PinnableSection {
|
||||
M.BarModule {
|
||||
id: root
|
||||
spacing: S.Theme.moduleSpacing
|
||||
_panelHovered: hoverPanel.panelHovered
|
||||
tooltip: S.NotifService.count > 0 ? "Notifications: " + S.NotifService.count + (S.NotifService.dnd ? " (DND)" : "") : (S.NotifService.dnd ? "Do not disturb" : "No notifications")
|
||||
|
||||
readonly property bool hasUrgent: S.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||
|
||||
|
|
@ -20,18 +20,12 @@ M.PinnableSection {
|
|||
}
|
||||
color: S.NotifService.dnd ? S.Theme.base04 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
}
|
||||
M.BarLabel {
|
||||
id: countLabel
|
||||
label: S.NotifService.count > 0 ? String(S.NotifService.count) + (root.hasUrgent ? "!" : "") : ""
|
||||
color: root.hasUrgent ? S.Theme.base08 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
TapHandler {
|
||||
onTapped: root._pinned = !root._pinned
|
||||
}
|
||||
|
||||
transform: Scale {
|
||||
id: countScale
|
||||
|
|
@ -83,6 +77,7 @@ M.PinnableSection {
|
|||
panelNamespace: "nova-notifications"
|
||||
panelTitle: "Notifications"
|
||||
contentWidth: 350
|
||||
onDismissed: root.dismissPanel()
|
||||
titleActionsComponent: Component {
|
||||
Row {
|
||||
spacing: 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue