diff --git a/Colors.js b/Colors.js index 0467c92..b0e3710 120000 --- a/Colors.js +++ b/Colors.js @@ -1 +1 @@ -/nix/store/l7wgb12q1ackaqs9v9g79p2pr567dsgk-home-manager-files/.config/quickshell/Colors.js \ No newline at end of file +/nix/store/yj22sprk8zwdhbc8jcf5nqbkc2vwd5yz-home-manager-files/.config/quickshell/Colors.js \ No newline at end of file diff --git a/Colors.qml b/Colors.qml index 3631629..9cf055a 100644 --- a/Colors.qml +++ b/Colors.qml @@ -7,11 +7,11 @@ import "Colors.js" as Colors Singleton { id: root - readonly property color accent: base0D - readonly property color rootBarColor: base00 + readonly property color accent: base0B + readonly property color rootBarColor: base01 readonly property color barBg: Qt.rgba(rootBarColor.r,rootBarColor.g,rootBarColor.b,Config.opacity) readonly property color moduleBg: base02 - readonly property color activeModuleBg: base04 + readonly property color activeModuleBg: base03 readonly property color text: base05 readonly property color base00: Colors.colors.base00 readonly property color base01: Colors.colors.base01 diff --git a/modules/Services/Compositor.qml b/modules/Services/Compositor.qml deleted file mode 100644 index 01d48fb..0000000 --- a/modules/Services/Compositor.qml +++ /dev/null @@ -1,20 +0,0 @@ -pragma Singleton -import Quickshell -import Quickshell.Wayland - -Singleton { - id: root - - // Screen des gerade fokussierten Fensters, oder null wenn keins fokussiert ist. - // Reagiert sowohl auf Fokuswechsel als auch darauf, dass das fokussierte - // Fenster auf einen anderen Monitor wandert. - readonly property ShellScreen liveScreen: ToplevelManager.activeToplevel?.screens?.[0] ?? null - - - property ShellScreen focusedScreen: Quickshell.screens[0] ?? null - - onLiveScreenChanged: { - if (liveScreen) - root.focusedScreen = liveScreen; - } -} diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index c41b4c5..a63620e 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -2,7 +2,7 @@ import Quickshell import QtQuick import QtQuick.Layouts import qs.settings -import qs.widgets +import qs.modules.applets import qs Variants { @@ -19,13 +19,13 @@ Variants { color: 'transparent' implicitHeight: Config.cfg.bar.height - margins.top: Config.cfg.bar.floating ?? 10 - margins.left: Config.cfg.bar.floating ?? 10 - margins.right: Config.cfg.bar.floating ?? 10 + margins.top: Config.cfg.bar.floating ? 10 : 0 + margins.left: Config.cfg.bar.floating ? 10 : 0 + margins.right: Config.cfg.bar.floating ? 10 : 0 Rectangle { anchors.fill: parent color: Colors.barBg - radius: Config.cfg.bar.floating ?? Config.cfg.appearance.rounding + radius: Config.cfg.bar.floating ? Config.cfg.appearance.rounding : 0 RowLayout { anchors.leftMargin: 4 anchors.left: parent.left @@ -33,9 +33,7 @@ Variants { Ws { barScreen: root.modelData } - ActiveWindow { - screen: root.modelData - } + ActiveWindow {screen: root.modelData} } RowLayout { anchors.centerIn: parent @@ -45,46 +43,15 @@ Variants { anchors.rightMargin: 4 anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - Mpris { - id: mpris - } - StyledText { - text: "|" - visible: mpris.visible - } - Bat { - id: bat - - } - StyledText { - text: "|" - visible: bat.visible - } - Tray { - id: tray - } - StyledText { - text: "|" - visible: tray.visible - } - WallPickerButton { - id: wpButton - barScreen: root.modelData - } - StyledText { - text: "|" - } + Mpris {} + Bat {} + Tray {} + WallPickerButton {barScreen: root.modelData} Pw { - id: pw barScreen: root.modelData } - StyledText { - text: "|" - } - Netstatus { - id: net - } + Netstatus {} } } } diff --git a/modules/bar/Ws.qml b/modules/bar/Ws.qml index 9e18da8..155bb08 100644 --- a/modules/bar/Ws.qml +++ b/modules/bar/Ws.qml @@ -11,17 +11,25 @@ BarComponent { required property ShellScreen barScreen implicitWidth: wsLayout.implicitWidth RowLayout { + id: wsLayout anchors.centerIn: parent - spacing: 4 + spacing: 0 Repeater { model: WindowManager.screenProjection(root.barScreen).windowsets delegate: BarComponent { id: wsContainer required property var modelData - implicitWidth: root.implicitHeight / 1.5 - implicitHeight: implicitWidth + visible: modelData.shouldDisplay + implicitWidth: modelData.active ? root.implicitHeight * 2.2 : root.implicitHeight color: modelData.active ? Colors.accent : 'transparent' + Behavior on implicitWidth { + PropertyAnimation { + duration: 350 + easing.type: Easing.InOutBack + easing.overshoot: 1.2 + } + } MouseArea { id: clickHandler anchors.fill: parent @@ -33,8 +41,7 @@ BarComponent { id: wsText anchors.centerIn: parent text: parent.modelData.name - color: parent.modelData.shouldDisplay ? parent.modelData.active ? Colors.base00 : Colors.base05 : Colors.base03 - font.bold: parent.modelData.active + color: parent.modelData.active ? Colors.base00 : Colors.text } } } diff --git a/modules/notifications/NotiPopup.qml b/modules/notifications/NotiPopup.qml new file mode 100644 index 0000000..dfbc980 --- /dev/null +++ b/modules/notifications/NotiPopup.qml @@ -0,0 +1,38 @@ +pragma ComponentBehavior: Bound +import Quickshell +import QtQuick +import Quickshell.Wayland +import qs.settings +import Quickshell.Hyprland +Variants { + model: Quickshell.screens + delegate: WlrLayershell { + required property ShellScreen modelData + id: notiPopup + exclusionMode: ExclusionMode.Ignore + layer: WlrLayer.Overlay + screen: modelData + anchors { + top: true + right: true + } + margins.top: Config.cfg.bar.height + 8 + (Config.cfg.bar.floating ? 10 : 0) + margins.right: 8 + implicitHeight: notiList.contentHeight + implicitWidth: modelData.width / 6 + 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 + nScreen: notiPopup.screen + notification: modelData + } + } + } +} diff --git a/modules/notifications/NotiServer.qml b/modules/notifications/NotiServer.qml index dac57ba..db79793 100644 --- a/modules/notifications/NotiServer.qml +++ b/modules/notifications/NotiServer.qml @@ -5,7 +5,7 @@ import QtQuick Singleton { id: root - property list notifications: server.trackedNotifications.values + property alias notifications: server.trackedNotifications NotificationServer { id: server imageSupported: true diff --git a/modules/overlays/#Top.qml# b/modules/overlays/#Top.qml# new file mode 100644 index 0000000..348760f --- /dev/null +++ b/modules/overlays/#Top.qml# @@ -0,0 +1,101 @@ +import QtQuick +import Quickshell +import Quickshell.Wayland +import qs.modules.Services +import qs.modules.applets +import qs.settings + +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 { + 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; + } + 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 + 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 + } + } + } + } + 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.LeftButton + onClicked: WidgetTracker.close() + } + } + } +} diff --git a/modules/overlays/Top.qml b/modules/overlays/Top.qml index 56f29df..79b82a7 100644 --- a/modules/overlays/Top.qml +++ b/modules/overlays/Top.qml @@ -4,7 +4,6 @@ import Quickshell.Wayland import qs.modules.Services import qs.modules.applets import qs.settings -import qs.modules.notifications Variants { model: Quickshell.screens @@ -24,12 +23,7 @@ Variants { color: 'transparent' visible: true mask: Region { - Region { - item: notiList.visible ? notiList : null - } - Region { - item: root.shown ? dismisser : null - } + item: root.shown ? dismisser : null } WlrLayershell.keyboardFocus: shown ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None Item { @@ -47,7 +41,7 @@ Variants { 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.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height anchors.rightMargin: 10 Behavior on opacity { NumberAnimation { @@ -65,27 +59,6 @@ Variants { } } } - - 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 diff --git a/settings/settings.json b/settings/settings.json index 5f187ab..81477d5 100644 --- a/settings/settings.json +++ b/settings/settings.json @@ -6,12 +6,12 @@ "rounding": 16 }, "bar": { - "floating": false, + "floating": true, "height": 34, "opacity": 1 }, "wallpaper": { "wallDir": "/home/lucy/.walls/", - "wallpaper": "/home/lucy/.walls/walkingcastle.png" + "wallpaper": "/home/lucy/.walls/faris.png" } } diff --git a/shell.qml b/shell.qml index 5a49b22..7a0a6e9 100644 --- a/shell.qml +++ b/shell.qml @@ -8,6 +8,7 @@ import qs.modules.Services ShellRoot { Bar {} + NotiPopup {} Bottom {} Top {} } diff --git a/widgets/BarComponent.qml b/widgets/BarComponent.qml index cb1c61c..011ab86 100644 --- a/widgets/BarComponent.qml +++ b/widgets/BarComponent.qml @@ -5,8 +5,7 @@ import qs.settings Rectangle { property bool active: false - color: active ? Colors.activeModuleBg : Colors.barBg - + color: active ? Colors.activeModuleBg : Colors.moduleBg implicitHeight: Config.cfg.bar.height - 8 radius: Config.cfg.appearance.rounding }