From a380963757b5f4abe89fefbf0835c979f6c7a4a5 Mon Sep 17 00:00:00 2001 From: SomeElse Date: Fri, 29 May 2026 01:59:43 +0000 Subject: [PATCH] reworked Workspace.qml to support specialworkspace, fixed launcher opening on two monitors, added slider animation back as an option --- bar/modules/Volume.qml | 48 +++++++-------------------------- bar/modules/Workspace.qml | 48 ++++++++++++++++++++++++++++----- components/PopupCard.qml | 34 ++++++++++++++++------- config/config.qml | 5 ++-- config/themes/aero.qml | 2 ++ config/themes/aurora.qml | 2 ++ config/themes/autumn.qml | 2 ++ config/themes/beach.qml | 2 ++ config/themes/boat.qml | 2 ++ config/themes/colorful.qml | 2 ++ config/themes/cosmic.qml | 2 ++ config/themes/everforest.qml | 2 ++ config/themes/goldencity.qml | 2 ++ config/themes/hummingbird.qml | 2 ++ config/themes/lowlight.qml | 2 ++ config/themes/metropolitan.qml | 2 ++ config/themes/neonica.qml | 2 ++ config/themes/pinkie.qml | 2 ++ config/themes/supreme.qml | 2 ++ config/themes/tropicalnight.qml | 2 ++ launcher/Launcher.qml | 10 ++++++- 21 files changed, 120 insertions(+), 57 deletions(-) diff --git a/bar/modules/Volume.qml b/bar/modules/Volume.qml index 35c3a45..9ee25b2 100644 --- a/bar/modules/Volume.qml +++ b/bar/modules/Volume.qml @@ -156,48 +156,21 @@ ModuleChip { } } - PopupPanel { + StandardPopup { id: volumePopup ns: "volume" chipRoot: root cardWidth: Cfg.Config.volumePopupWidth + cardColor: root.t.volPopupBg + cardBorderColor: root.t.volPopupBorder + cardHeight: popupCol.implicitHeight + 30 - Rectangle { - id: volCard - width: parent.width - height: popupCol.implicitHeight + 30 - - anchors.top: root.isTop ? parent.top : undefined - anchors.bottom: root.isTop ? undefined : parent.bottom - - transform: Scale { - yScale: volumePopup.popupOpen ? 1 : 0 - origin.y: root.isTop ? 0 : volCard.height - Behavior on yScale { - NumberAnimation { - duration: Cfg.Config.popupAnimDuration - easing.type: Easing.OutBack - } - enabled: volumePopup.visible - } - } - - opacity: volumePopup.popupOpen ? 1.0 : 0.0 - Behavior on opacity { NumberAnimation { duration: 200 } } - - radius: Cfg.Config.popupRadius - color: root.t.volPopupBg - border.color: root.t.volPopupBorder - border.width: Cfg.Config.popupBorderWidth - - MouseArea { anchors.fill: parent; propagateComposedEvents: false } - - ColumnLayout { - id: popupCol - anchors { left: parent.left; right: parent.right; top: parent.top } - anchors.margins: 16 - anchors.topMargin: 16 - spacing: 16 + ColumnLayout { + id: popupCol + anchors { left: parent.left; right: parent.right; top: parent.top } + anchors.margins: 16 + anchors.topMargin: 16 + spacing: 16 VolumeSection { id: outputSection @@ -294,7 +267,6 @@ ModuleChip { } Item { height: 0 } } - } } component VolumeSection: ColumnLayout { diff --git a/bar/modules/Workspace.qml b/bar/modules/Workspace.qml index 6e35366..77b8058 100644 --- a/bar/modules/Workspace.qml +++ b/bar/modules/Workspace.qml @@ -13,6 +13,22 @@ ModuleChip { chipColor: t.wsPanelBg chipBorderColor: t.wsPanelBorder + property string activeSpecial: "" + property string lastActiveName: "" + + Connections { + target: Hyprland + function onRawEvent(event) { + if (event.name === "activespecial") { + var name = event.data.split(",")[0] + root.activeSpecial = name + } + if (event.name === "workspace") { + root.lastActiveName = event.data + } + } + } + RowLayout { id: workspaceLayout anchors.centerIn: parent @@ -22,13 +38,25 @@ ModuleChip { model: Hyprland.workspaces Rectangle { - Layout.preferredWidth: modelData.active ? 34 : 28 + id: wsPill + + visible: modelData.name !== "special:magic" + + property bool isSelected: modelData.active || (root.activeSpecial !== "" && modelData.name === root.lastActiveName) + + Layout.preferredWidth: isSelected ? 34 : 28 Layout.preferredHeight: 22 radius: 11 - color: modelData.active - ? root.t.wsActiveBg - : (wsHover.hovered ? root.t.wsHoverBg : root.t.wsInactiveBg) + color: { + if (isSelected && root.activeSpecial !== "") { + return root.t.wsMagicActiveBg + } + if (modelData.active) { + return root.t.wsActiveBg + } + return wsHover.hovered ? root.t.wsHoverBg : root.t.wsInactiveBg + } Behavior on color { ColorAnimation { duration: 200 } } Behavior on Layout.preferredWidth { NumberAnimation { duration: 200 } } @@ -38,9 +66,15 @@ ModuleChip { text: modelData.name font.pixelSize: 11 font.bold: true - color: modelData.active - ? root.t.wsActiveText - : (wsHover.hovered ? root.t.wsHoverText : root.t.wsInactiveText) + color: { + if (isSelected && root.activeSpecial !== "") { + return root.t.wsMagicActiveText + } + if (modelData.active) { + return root.t.wsActiveText + } + return wsHover.hovered ? root.t.wsHoverText : root.t.wsInactiveText + } } HoverHandler { id: wsHover; cursorShape: Qt.PointingHandCursor } diff --git a/components/PopupCard.qml b/components/PopupCard.qml index 7794f5f..7257997 100644 --- a/components/PopupCard.qml +++ b/components/PopupCard.qml @@ -14,17 +14,33 @@ Rectangle { anchors.top: isTop ? parent.top : undefined anchors.bottom: isTop ? undefined : parent.bottom - transform: Scale { - yScale: popupOpen ? 1 : 0 - origin.y: isTop ? 0 : card.height - Behavior on yScale { - NumberAnimation { - duration: Cfg.Config.popupAnimDuration - easing.type: Easing.OutBack + transform: [ + Scale { + yScale: Cfg.Config.popupAnimType === "bubbleslide" + ? (popupOpen ? 1 : 0) + : 1 + origin.y: isTop ? 0 : card.height + Behavior on yScale { + NumberAnimation { + duration: Cfg.Config.popupAnimDuration + easing.type: Easing.OutBack + } + enabled: animEnabled + } + }, + Translate { + y: Cfg.Config.popupAnimType === "slide" + ? (popupOpen ? 0 : (isTop ? -card.height : card.height)) + : 0 + Behavior on y { + NumberAnimation { + duration: Cfg.Config.popupAnimDuration + easing.type: Easing.OutCubic + } + enabled: animEnabled } - enabled: animEnabled } - } + ] opacity: popupOpen ? 1.0 : 0.0 Behavior on opacity { NumberAnimation { duration: 200 } } diff --git a/config/config.qml b/config/config.qml index f5d3538..8725000 100644 --- a/config/config.qml +++ b/config/config.qml @@ -6,7 +6,7 @@ import "themes" QtObject { id: root - readonly property var theme: Lowlight + readonly property var theme: Goldencity // ──────────────────────────────────────────────────────────────────────── // Widgets @@ -23,7 +23,7 @@ QtObject { // ──────────────────────────────────────────────────────────────────────── // ── Position & Dimensions ───────────────────────────────────────────────── - property string barPosition: "top" + property string barPosition: "bottom" property int barHeight: 35 property int margin: 15 property int radius: 20 @@ -48,6 +48,7 @@ QtObject { property int popupRadius: 18 property int popupBorderWidth: 1 property int popupAnimDuration: 250 + property string popupAnimType: "slide" // "bubbleslide" or "slide" // ── Clock Module ───────────────────────────────────────────────────────── property bool clockExtendEnabled: true // seconds extension on hover for clock diff --git a/config/themes/aero.qml b/config/themes/aero.qml index 4b037b9..2d89355 100644 --- a/config/themes/aero.qml +++ b/config/themes/aero.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff0b3333" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/aurora.qml b/config/themes/aurora.qml index 36cd15f..e3c1bbe 100644 --- a/config/themes/aurora.qml +++ b/config/themes/aurora.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff050a14" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/autumn.qml b/config/themes/autumn.qml index c6a7e0f..6c41b36 100644 --- a/config/themes/autumn.qml +++ b/config/themes/autumn.qml @@ -187,6 +187,8 @@ QtObject { readonly property color wsActiveText: "#ff0c0e12" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#fff8e7c9" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/beach.qml b/config/themes/beach.qml index 80a36a1..a05a38b 100644 --- a/config/themes/beach.qml +++ b/config/themes/beach.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff1a212e" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/boat.qml b/config/themes/boat.qml index 8857899..48d8ee9 100644 --- a/config/themes/boat.qml +++ b/config/themes/boat.qml @@ -187,6 +187,8 @@ QtObject { readonly property color wsActiveText: "#ff0e0a0d" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/colorful.qml b/config/themes/colorful.qml index f41d2e4..b4ab470 100644 --- a/config/themes/colorful.qml +++ b/config/themes/colorful.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff1c2433" // Dark text on pink readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/cosmic.qml b/config/themes/cosmic.qml index 8d6a9d5..a5e72ac 100644 --- a/config/themes/cosmic.qml +++ b/config/themes/cosmic.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff0d1326" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/everforest.qml b/config/themes/everforest.qml index 2d5ef66..d57fe63 100644 --- a/config/themes/everforest.qml +++ b/config/themes/everforest.qml @@ -190,6 +190,8 @@ QtObject { readonly property color wsActiveText: "#ff070e08" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/goldencity.qml b/config/themes/goldencity.qml index 9c8a4d1..8635408 100644 --- a/config/themes/goldencity.qml +++ b/config/themes/goldencity.qml @@ -187,6 +187,8 @@ QtObject { readonly property color wsActiveText: "#ff0c0e12" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: wsActiveText // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/hummingbird.qml b/config/themes/hummingbird.qml index c9392ac..b1dc6ac 100644 --- a/config/themes/hummingbird.qml +++ b/config/themes/hummingbird.qml @@ -187,6 +187,8 @@ QtObject { readonly property color wsActiveText: "#ff0d140d" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/lowlight.qml b/config/themes/lowlight.qml index 05bbdd3..beb3edd 100644 --- a/config/themes/lowlight.qml +++ b/config/themes/lowlight.qml @@ -190,6 +190,8 @@ QtObject { readonly property color wsActiveText: "#ff07091c" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/metropolitan.qml b/config/themes/metropolitan.qml index 2aec3c9..799df25 100644 --- a/config/themes/metropolitan.qml +++ b/config/themes/metropolitan.qml @@ -180,6 +180,8 @@ QtObject { readonly property color wsActiveText: "#ff0d1117" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/neonica.qml b/config/themes/neonica.qml index 2762d90..ad39b29 100644 --- a/config/themes/neonica.qml +++ b/config/themes/neonica.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff0d0b1c" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/pinkie.qml b/config/themes/pinkie.qml index a684013..066ed85 100644 --- a/config/themes/pinkie.qml +++ b/config/themes/pinkie.qml @@ -190,6 +190,8 @@ QtObject { readonly property color wsActiveText: "#ff0d0b1c" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/supreme.qml b/config/themes/supreme.qml index 66646b8..9beaa00 100644 --- a/config/themes/supreme.qml +++ b/config/themes/supreme.qml @@ -179,6 +179,8 @@ QtObject { readonly property color wsActiveText: "#ff2d1621" // Dark contrast readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffffffff" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/config/themes/tropicalnight.qml b/config/themes/tropicalnight.qml index 9ec44c5..0496b72 100644 --- a/config/themes/tropicalnight.qml +++ b/config/themes/tropicalnight.qml @@ -188,6 +188,8 @@ QtObject { readonly property color wsActiveText: "#ff0c0e12" readonly property color wsInactiveText: textMain readonly property color wsHoverText: "#ffccd1d4" + readonly property color wsMagicActiveBg: "#ff9b6df5" + readonly property color wsMagicActiveText: "#ff0c0e12" // ── Tray Module ──────────────────────────────────────────────────────────── readonly property color trayBg: bgPanel diff --git a/launcher/Launcher.qml b/launcher/Launcher.qml index 7fcf335..d073181 100644 --- a/launcher/Launcher.qml +++ b/launcher/Launcher.qml @@ -42,9 +42,17 @@ PanelWindow { return allItems.filter(i => i.name.toLowerCase().includes(q)) } - function toggle() { _isOpen ? close() : open() } + function toggle() { + if (!_isOpen) { + var fm = Hyprland.focusedMonitor + if (!fm || fm.name !== screen.name) return + } + _isOpen ? close() : open() + } function open() { + var fm = Hyprland.focusedMonitor + if (!fm || fm.name !== screen.name) return closeTimer.stop() visible = true _isOpen = true