136 lines
4.5 KiB
QML
136 lines
4.5 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Wayland
|
|
import qs.modules.Services
|
|
import qs.modules.applets
|
|
import qs.settings
|
|
import qs.modules.notifications
|
|
|
|
Variants {
|
|
model: Quickshell.screens
|
|
delegate: PanelWindow {
|
|
id: root
|
|
required property ShellScreen modelData
|
|
property bool shown: WidgetTracker.current !== "" && WidgetTracker.screen === modelData
|
|
|
|
screen: modelData
|
|
anchors {
|
|
top: true
|
|
left: true
|
|
bottom: true
|
|
right: true
|
|
}
|
|
exclusionMode: ExclusionMode.Ignore
|
|
color: 'transparent'
|
|
visible: true
|
|
mask: Region {
|
|
Region {
|
|
item: notiList.visible ? notiList : null
|
|
}
|
|
Region {
|
|
item: root.shown ? dismisser : null
|
|
}
|
|
}
|
|
WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
|
Item {
|
|
anchors.fill: parent
|
|
focus: true
|
|
Keys.onEscapePressed: event => {
|
|
WidgetTracker.close();
|
|
event.accepted = true;
|
|
}
|
|
ThemeSwitcher {
|
|
z: 1
|
|
anchors.centerIn: parent
|
|
visible: persist.shown
|
|
PersistentProperties {
|
|
id: persist
|
|
reloadableId: "visible"
|
|
property bool shown: root?.shown && WidgetTracker?.current === "colors"
|
|
}
|
|
}
|
|
VolPopup {
|
|
id: volPopup
|
|
z: 1
|
|
property bool shown: root.shown && WidgetTracker.current === "volume"
|
|
opacity: shown ? 1 : 0
|
|
visible: opacity > 0
|
|
anchors.right: parent.right
|
|
anchors.top: parent.top
|
|
anchors.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height + 10
|
|
anchors.rightMargin: 10
|
|
Behavior on opacity {
|
|
NumberAnimation {
|
|
duration: 140
|
|
easing.type: Easing.OutCubic
|
|
}
|
|
}
|
|
transform: Translate {
|
|
y: volPopup.shown ? 0 : -12
|
|
Behavior on y {
|
|
NumberAnimation {
|
|
duration: 140
|
|
easing.type: Easing.OutCubic
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
ListView {
|
|
id: notiList
|
|
z: 2
|
|
anchors.top: parent.top
|
|
anchors.right: parent.right
|
|
anchors.topMargin: Config.cfg.bar.height + 10 + (Config.cfg.bar.floating ? 10 : 0)
|
|
anchors.rightMargin: 10
|
|
width: root.modelData.width / 6
|
|
height: contentHeight
|
|
interactive: false
|
|
visible: count > 0 && Compositor.focusedScreen === root.modelData
|
|
|
|
model: NotiServer.notifications
|
|
spacing: 6
|
|
delegate: NotiCard {
|
|
required property var modelData
|
|
nScreen: root.modelData
|
|
notification: modelData
|
|
}
|
|
}
|
|
WallPicker {
|
|
id: wallpapers
|
|
z: 1
|
|
property bool shown: root.shown && WidgetTracker.current === "wallpapers"
|
|
opacity: shown ? 1 : 0
|
|
visible: opacity > 0
|
|
anchors.bottom: parent.bottom
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
anchors.margins: 20
|
|
implicitWidth: 1000
|
|
implicitHeight: 200
|
|
Behavior on opacity {
|
|
NumberAnimation {
|
|
duration: 200
|
|
easing.type: Easing.OutCubic
|
|
}
|
|
}
|
|
transform: Translate {
|
|
y: wallpapers.shown ? 0 : 12
|
|
Behavior on y {
|
|
NumberAnimation {
|
|
duration: 200
|
|
easing.type: Easing.OutCubic
|
|
}
|
|
}
|
|
}
|
|
}
|
|
MouseArea {
|
|
id: dismisser
|
|
z: 0
|
|
anchors.fill: parent
|
|
acceptedButtons: Qt.AllButtons
|
|
onClicked: WidgetTracker.close()
|
|
}
|
|
}
|
|
}
|
|
}
|