working notifications
This commit is contained in:
parent
cf4696fe04
commit
e1504bfc92
5 changed files with 112 additions and 0 deletions
46
modules/notifications/NotiPopup.qml
Normal file
46
modules/notifications/NotiPopup.qml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import Quickshell.Wayland
|
||||
import qs.settings
|
||||
import Quickshell.Hyprland
|
||||
|
||||
WlrLayershell {
|
||||
id: notiPopup
|
||||
property ShellScreen activeScreen: getActiveScreen()
|
||||
function getActiveScreen() {
|
||||
let current = Quickshell.screens[0];
|
||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||
current = Quickshell.screens[i];
|
||||
if (Hyprland.monitorFor(current) == Hyprland.focusedMonitor) {
|
||||
console.log(current.name);
|
||||
return current;
|
||||
}
|
||||
}
|
||||
return current;
|
||||
}
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
layer: WlrLayer.Overlay
|
||||
screen: activeScreen
|
||||
anchors {
|
||||
top: true
|
||||
right: true
|
||||
}
|
||||
margins.top: Config.barHeight + 8
|
||||
margins.right: 8
|
||||
implicitHeight: notiList.contentHeight
|
||||
implicitWidth: activeScreen.width / 8
|
||||
color: 'transparent'
|
||||
visible: NotiServer.notifications.values.length > 0
|
||||
|
||||
ListView {
|
||||
id: notiList
|
||||
anchors.fill: parent
|
||||
model: NotiServer.notifications
|
||||
spacing: 6
|
||||
delegate: NotiCard {
|
||||
required property var modelData
|
||||
notification: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue