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)