From af81bf9c903c7c94b4124ac38ec7f49c90f8a1f3 Mon Sep 17 00:00:00 2001 From: mx Date: Sat, 14 Nov 2026 14:49:07 +0100 Subject: [PATCH] Keep the notch's colour on the launcher The launcher used the open notch's fill, so with "Glassy when open" it turned back to glass. It now keeps the docked notch's colour by default; notch.launcherMatch ("Launcher keeps notch colour", shown under the glassy toggle) can turn it off to follow the open notch again. Co-Authored-By: Claude Opus 5.5 --- quickshell/config/defaults.json | 1 + quickshell/launcher/Launcher.qml | 4 ++-- quickshell/services/ConfigLogic.js | 2 +- quickshell/settings/pages/Notch.qml | 9 ++++++++- quickshell/theme/Theme.qml | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/quickshell/config/defaults.json b/quickshell/config/defaults.json index ba04e69..200ecce 100644 --- a/quickshell/config/defaults.json +++ b/quickshell/config/defaults.json @@ -272,6 +272,7 @@ "opacity": 0, "color": "", "glassOnOpen": false, + "launcherMatch": true, "openSpeed": 100, "closeSpeed": 100, "colorSpeed": 100, diff --git a/quickshell/launcher/Launcher.qml b/quickshell/launcher/Launcher.qml index b10ab51..2ddea83 100644 --- a/quickshell/launcher/Launcher.qml +++ b/quickshell/launcher/Launcher.qml @@ -311,8 +311,8 @@ PanelWindow { bodyHeight: panel.height ear: BarDrawers.ear radius: panel.radius - // Docked colour, turning to the open fill as the launcher unfolds. - fillColor: ShellState.launcherOpen ? Theme.notchOpenFill : Theme.notchFill + // Docked colour; the open fill only if the launcher follows "glassy when open". + fillColor: ShellState.launcherOpen ? Theme.notchLauncherFill : Theme.notchFill Behavior on fillColor { ColorAnimation { duration: ShellState.launcherOpen ? Theme.notchColorDuration : Math.min(Theme.notchColorDuration, Theme.notchCloseDuration) diff --git a/quickshell/services/ConfigLogic.js b/quickshell/services/ConfigLogic.js index cf1ac9c..98fce60 100644 --- a/quickshell/services/ConfigLogic.js +++ b/quickshell/services/ConfigLogic.js @@ -88,7 +88,7 @@ function validate(c) { for(const key of ["left","right","strip"]) if(!Array.isArray(c.notch[key]) || c.notch[key].some(id=>typeof id!=="string" || !id))throw Error("Invalid notch modules"); if(!Array.isArray(c.notch.controls) || c.notch.controls.some(m=>!m || typeof m.id!=="string" || typeof m.enabled!=="boolean" || ["w","h"].some(k=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<1 || m[k]>4)) || [["x",3],["y",63]].some(([k,max])=>m[k]!==undefined && (!Number.isInteger(m[k]) || m[k]<0 || m[k]>max))))throw Error("Invalid notch controls"); if(!Number.isFinite(c.notch.opacity) || c.notch.opacity<0 || c.notch.opacity>100 || typeof c.notch.color!=="string" || (c.notch.color!=="" && !/^#[0-9a-fA-F]{6}$/.test(c.notch.color)))throw Error("Invalid notch colour"); - if(typeof c.notch.glassOnOpen!=="boolean" || ["openSpeed","closeSpeed","colorSpeed"].some(k=>!Number.isFinite(c.notch[k]) || c.notch[k]<25 || c.notch[k]>300))throw Error("Invalid notch animation"); + if(typeof c.notch.glassOnOpen!=="boolean" || typeof c.notch.launcherMatch!=="boolean" || ["openSpeed","closeSpeed","colorSpeed"].some(k=>!Number.isFinite(c.notch[k]) || c.notch[k]<25 || c.notch[k]>300))throw Error("Invalid notch animation"); if(!["bar","numbers","roman","kanji","dots","pacman"].includes(c.notch.workspaceStyle))throw Error("Invalid notch workspace style"); if(typeof c.osd.enabled!=="boolean" || !["slide","drop","fade","shrink"].includes(c.osd.animation) || !["top-right","top-center","bottom-center"].includes(c.osd.position) || !Number.isInteger(c.osd.timeout) || c.osd.timeout<500 || c.osd.timeout>5000 || !Number.isInteger(c.osd.step) || c.osd.step<1 || c.osd.step>20)throw Error("Invalid OSD preferences"); const notes=c.notifications; diff --git a/quickshell/settings/pages/Notch.qml b/quickshell/settings/pages/Notch.qml index 6773d07..a04e6ab 100644 --- a/quickshell/settings/pages/Notch.qml +++ b/quickshell/settings/pages/Notch.qml @@ -87,10 +87,17 @@ SettingsPage { } PreferenceToggle { label: "Glassy when open" - description: "Keeps the colour and opacity on the docked notch; the open notch and launcher fade back to the normal glass" + description: "Keeps the colour and opacity on the docked notch; the open notch fades back to the normal glass" icon: "󰂵" setting: "notch.glassOnOpen" } + PreferenceToggle { + visible: root.options.glassOnOpen + label: "Launcher keeps notch colour" + description: "Off: the launcher turns glassy when open too" + icon: "󰍉" + setting: "notch.launcherMatch" + } PreferenceSlider { label: "Opening speed" description: "Notch and launcher; 100% follows the shell's animation duration" diff --git a/quickshell/theme/Theme.qml b/quickshell/theme/Theme.qml index 5ea1b77..403c17c 100644 --- a/quickshell/theme/Theme.qml +++ b/quickshell/theme/Theme.qml @@ -42,6 +42,9 @@ Singleton { } // The open notch's fill: the plain glass when "glassy when open" is on. readonly property color notchOpenFill: ConfigService.ready && ConfigService.data.notch.glassOnOpen ? Qt.alpha(tint, glassOpacity) : notchFill + // The launcher keeps the docked notch's colour unless it is set to follow + // "glassy when open". + readonly property color notchLauncherFill: ConfigService.ready && !ConfigService.data.notch.launcherMatch ? notchOpenFill : notchFill // Notch animations run at their own speeds (percent; 100 follows the shell), // one for opening and one for closing. readonly property real notchOpenDuration: duration * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.openSpeed) : 100)