mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
put shell in subdir, and add nix package
This commit is contained in:
parent
c45c04e9ac
commit
f41ea4b1cb
100 changed files with 57 additions and 126 deletions
98
shell/notifications/Controller.qml
Normal file
98
shell/notifications/Controller.qml
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import ".."
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
|
||||
Connections {
|
||||
target: Notifications.notificationServer
|
||||
|
||||
function onNotification(notification) {
|
||||
notificationLoader.item.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
id: notificationLoader
|
||||
loading: true
|
||||
|
||||
PanelWindow {
|
||||
id: notificationWindow
|
||||
property var visibleCount: {
|
||||
let count = 0;
|
||||
|
||||
for (let i = 0; i < toastList.count; i++) {
|
||||
let item = toastList.itemAt(i);
|
||||
|
||||
if (item && item.visible) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
onVisibleCountChanged: visible = visibleCount != 0
|
||||
|
||||
color: "transparent"
|
||||
implicitWidth: 525
|
||||
visible: false
|
||||
exclusionMode: ExclusionMode.Normal
|
||||
|
||||
mask: Region {
|
||||
item: notifLayout
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
right: true
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "length: " + notificationWindow.visibleCount
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: notifLayout
|
||||
spacing: 15
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: 5
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: toastList
|
||||
model: ScriptModel {
|
||||
values: Notifications.notificationServer.trackedNotifications.values.concat()
|
||||
}
|
||||
|
||||
delegate: ActiveToast {
|
||||
id: toast
|
||||
required property var modelData
|
||||
notification: modelData
|
||||
|
||||
Connections {
|
||||
target: toast
|
||||
|
||||
function onExpired(notification) {
|
||||
toast.visible = false;
|
||||
}
|
||||
|
||||
function onClosed(notification) {
|
||||
notification.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue