reorganize repo: move shell sources into shell/, test scripts into test/
This commit is contained in:
parent
344c1f8512
commit
d6cd2f173a
60 changed files with 2 additions and 2 deletions
|
|
@ -1,94 +0,0 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
import "." as M
|
||||
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: M.Theme.moduleSpacing
|
||||
tooltip: {
|
||||
const parts = [M.NotifService.count + " notification" + (M.NotifService.count !== 1 ? "s" : "")];
|
||||
if (M.NotifService.dnd)
|
||||
parts.push("Do not disturb");
|
||||
return parts.join("\n");
|
||||
}
|
||||
|
||||
required property var bar
|
||||
|
||||
readonly property bool hasUrgent: M.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||
|
||||
M.BarIcon {
|
||||
icon: {
|
||||
if (M.NotifService.dnd)
|
||||
return M.NotifService.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
|
||||
return M.NotifService.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
|
||||
}
|
||||
color: M.NotifService.dnd ? M.Theme.base04 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
M.BarLabel {
|
||||
id: countLabel
|
||||
label: M.NotifService.count > 0 ? String(M.NotifService.count) + (root.hasUrgent ? "!" : "") : ""
|
||||
color: root.hasUrgent ? M.Theme.base08 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
transform: Scale {
|
||||
id: countScale
|
||||
origin.x: countLabel.width / 2
|
||||
origin.y: countLabel.height / 2
|
||||
xScale: 1
|
||||
yScale: 1
|
||||
}
|
||||
|
||||
SequentialAnimation {
|
||||
id: popAnim
|
||||
NumberAnimation {
|
||||
target: countScale
|
||||
properties: "xScale,yScale"
|
||||
to: 1.4
|
||||
duration: 100
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
NumberAnimation {
|
||||
target: countScale
|
||||
properties: "xScale,yScale"
|
||||
to: 1.0
|
||||
duration: 200
|
||||
easing.type: Easing.OutElastic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: M.NotifService
|
||||
function onCountChanged() {
|
||||
if (M.NotifService.count > 0)
|
||||
popAnim.start();
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onTapped: {
|
||||
centerLoader.active = !centerLoader.active;
|
||||
M.FlyoutState.visible = false;
|
||||
}
|
||||
}
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onTapped: M.NotifService.toggleDnd()
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
id: centerLoader
|
||||
active: false
|
||||
M.NotifCenter {
|
||||
accentColor: root.accentColor
|
||||
screen: root.bar.screen
|
||||
anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0)
|
||||
onDismissed: centerLoader.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue