From b03bd77941964f6150cf1bd711f62e119959d583 Mon Sep 17 00:00:00 2001 From: mx Date: Thu, 26 Nov 2026 14:06:14 +0100 Subject: [PATCH] Give notch-mode panels their own liquid drop animation With no bar to unroll from, attached drawers in notch mode now open as a glass bead that swells out under the clicked island icon on a tapered neck, flips the wallpaper behind it like a lens, then widens into the panel and lets go. NotchDrop draws it with a signed-distance shader; BarDrawer swaps to it in notch mode, and hosts pass the icon's screen x. The notch-shaped wallpaper picker keeps its own motion. Notch settings gain panel opening and closing speeds. Co-Authored-By: Claude Opus 5.5 --- quickshell/bar/BarPopout.qml | 1 + quickshell/compat/noctalia/Host/PanelHost.qml | 1 + .../compat/omarchy/Ui/GlassPopupBase.qml | 1 + quickshell/components/BarDrawer.qml | 46 ++++++- quickshell/components/NotchDrop.qml | 120 ++++++++++++++++++ quickshell/components/shaders/notchdrop.frag | 96 ++++++++++++++ .../components/shaders/notchdrop.frag.qsb | Bin 0 -> 7182 bytes quickshell/config/defaults.json | 2 + quickshell/menus/TrayMenu.qml | 1 + quickshell/services/ConfigLogic.js | 2 +- quickshell/settings/pages/Notch.qml | 19 +++ quickshell/theme/Theme.qml | 3 + quickshell/wallpaper/WallpaperPicker.qml | 2 + scripts/build-shaders | 2 +- 14 files changed, 287 insertions(+), 9 deletions(-) create mode 100644 quickshell/components/NotchDrop.qml create mode 100644 quickshell/components/shaders/notchdrop.frag create mode 100644 quickshell/components/shaders/notchdrop.frag.qsb diff --git a/quickshell/bar/BarPopout.qml b/quickshell/bar/BarPopout.qml index 870002e..7db1d20 100644 --- a/quickshell/bar/BarPopout.qml +++ b/quickshell/bar/BarPopout.qml @@ -96,6 +96,7 @@ PanelWindow { drawerId: "popout" screenName: root.screen ? root.screen.name : "" screenX: root.animX + sourceScreenX: root.anchorPoint.x + (root.placementItem ? root.placementItem.width / 2 : 0) onHoveredChanged: PopoutState.setPopoutHovered(hovered) Text { id: tip diff --git a/quickshell/compat/noctalia/Host/PanelHost.qml b/quickshell/compat/noctalia/Host/PanelHost.qml index 2744768..fa7478a 100644 --- a/quickshell/compat/noctalia/Host/PanelHost.qml +++ b/quickshell/compat/noctalia/Host/PanelHost.qml @@ -84,6 +84,7 @@ PanelWindow { drawerId: "noctalia-panel-" + (root.api ? root.api.pluginId : "") screenName: root.screen ? root.screen.name : "" screenX: root.drawerX + sourceScreenX: root.fromBar ? root.anchorCenter : -1 focus: root.open Keys.onEscapePressed: root.api.closePanel(null) diff --git a/quickshell/compat/omarchy/Ui/GlassPopupBase.qml b/quickshell/compat/omarchy/Ui/GlassPopupBase.qml index 345b5e6..94a3d7c 100644 --- a/quickshell/compat/omarchy/Ui/GlassPopupBase.qml +++ b/quickshell/compat/omarchy/Ui/GlassPopupBase.qml @@ -165,6 +165,7 @@ PanelWindow { drawerId: "plugin-popup-" + (root.owner && root.owner.moduleName ? root.owner.moduleName : "") screenName: root.screen ? root.screen.name : "" screenX: root.drawerX + sourceScreenX: root.centerOnBar ? -1 : root.anchorScreenPos.x + root.anchorW / 2 // Swallow clicks on the card so they never reach the outside catcher. MouseArea { diff --git a/quickshell/components/BarDrawer.qml b/quickshell/components/BarDrawer.qml index 228a7e5..89176e5 100644 --- a/quickshell/components/BarDrawer.qml +++ b/quickshell/components/BarDrawer.qml @@ -21,17 +21,27 @@ Item { // "slide" unrolls out of the bar; "drop" falls into place and away // downwards; "fade" fades in place; "shrink" grows from / shrinks to nothing. property string style: "slide" + // Notch mode has no bar to unroll from: attached drawers use NotchDrop + // instead, with the notch's own panel speeds. Opt out with `liquid: false`. + property bool liquid: ShellState.notchMode && attached + // Screen x of the icon the drawer belongs to; the drop comes out under it. + property real sourceScreenX: -1 // Fill and timing; notch mode passes the notch's own. property color fillColor: Qt.alpha(Theme.surface, Theme.glassOpacity) property real openDuration: Theme.duration * 1.8 property real closeDuration: Theme.duration - readonly property bool unrolls: style === "slide" + readonly property bool unrolls: style === "slide" && !liquid property real progress: open ? 1 : 0 readonly property real revealed: unrolls ? Math.max(0, contentHeight * progress) : contentHeight // Drop moves down on the way in and on the way out. property real dropFrom: -1 onOpenChanged: dropFrom = open ? -1 : 1 readonly property bool shown: progress > 0.001 + // NotchDrop's content fade: in once the panel has its size, out first. + readonly property real dropContent: { + const t = Math.min(1, Math.max(0, (progress - 0.82) / 0.18)); + return t * t * (3 - 2 * t); + } readonly property bool settled: !anim.running && open // Input/hover region: the full body as soon as it opens (the pointer may // reach the drawer before the reveal finishes), the visible part while closing. @@ -43,8 +53,9 @@ Item { Behavior on progress { NumberAnimation { id: anim - duration: root.open ? root.openDuration : root.closeDuration - easing.type: Easing.BezierSpline + duration: root.liquid ? (root.open ? Theme.notchPanelOpenDuration : Theme.notchPanelCloseDuration) : root.open ? root.openDuration : root.closeDuration + // NotchDrop eases each phase itself. + easing.type: root.liquid ? Easing.Linear : Easing.BezierSpline easing.bezierCurve: root.open ? [0.05, 0.7, 0.1, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1] } } @@ -69,14 +80,32 @@ Item { id: motion width: root.width height: root.height - opacity: root.style === "fade" || root.style === "drop" ? root.progress : root.style === "shrink" ? Math.min(1, root.progress * 1.5) : 1 - scale: root.style === "shrink" ? Math.max(0.001, root.progress) : 1 + opacity: root.liquid ? 1 : root.style === "fade" || root.style === "drop" ? root.progress : root.style === "shrink" ? Math.min(1, root.progress * 1.5) : 1 + scale: !root.liquid && root.style === "shrink" ? Math.max(0.001, root.progress) : 1 transformOrigin: Item.Center transform: Translate { - y: root.style === "drop" ? (1 - root.progress) * 28 * root.dropFrom * Math.max(0.3, Theme.intensity) : 0 + y: !root.liquid && root.style === "drop" ? (1 - root.progress) * 28 * root.dropFrom * Math.max(0.3, Theme.intensity) : 0 + } + Loader { + active: root.liquid + width: root.width + sourceComponent: NotchDrop { + width: root.width + progress: root.progress + bodyX: root.ear + bodyWidth: root.contentWidth + bodyHeight: root.contentHeight + sourceX: root.sourceScreenX < 0 ? -1 : root.sourceScreenX - root.screenX + topSpace: Math.max(0, root.y) + islandBottom: Math.round((BarDrawers.bottom - BarDrawers.height) / 2) + BarDrawers.height - root.y + fillColor: root.fillColor + screenName: root.screenName + screenX: root.screenX + } } DrawerShape { id: shape + visible: !root.liquid bodyWidth: root.contentWidth bodyHeight: root.revealed ear: BarDrawers.ear @@ -94,7 +123,10 @@ Item { width: root.contentWidth height: root.contentHeight y: root.revealed - root.contentHeight - opacity: root.unrolls ? Math.min(1, root.progress * 1.6) : 1 + opacity: root.liquid ? root.dropContent : root.unrolls ? Math.min(1, root.progress * 1.6) : 1 + transform: Translate { + y: root.liquid ? (1 - root.dropContent) * 6 : 0 + } } } } diff --git a/quickshell/components/NotchDrop.qml b/quickshell/components/NotchDrop.qml new file mode 100644 index 0000000..fe41c76 --- /dev/null +++ b/quickshell/components/NotchDrop.qml @@ -0,0 +1,120 @@ +import QtQuick +import Quickshell +import "../services" +import "../theme" + +// Notch mode's own panel animation (BarDrawer swaps to it while notch mode +// is on). There is no bar to unroll from, so a glass bead swells out under the +// clicked island icon on a tapered neck, works as a lens on the wallpaper +// while it hangs, then widens into the panel and lets go of the island. +// Drawer-local coordinates; `progress` runs linearly, the easing lives here. +Item { + id: root + property real progress: 0 + property real bodyX: 0 + property real bodyWidth: 300 + property real bodyHeight: 200 + // Drawer-local x of the icon the panel belongs to; -1 is the middle. + property real sourceX: -1 + // Distance from the screen top to the drawer's top edge. + property real topSpace: 0 + // Drawer-local y of the islands' bottom edge (negative: above the drawer). + property real islandBottom: -5 + property real radius: Theme.radius + property color fillColor: Qt.alpha(Theme.surface, Theme.glassOpacity) + property color borderColor: Theme.border + property string screenName: "" + property real screenX: 0 + + y: -topSpace + height: topSpace + bodyHeight + visible: progress > 0.002 + + function clamp(x, a, b) { + return Math.min(b, Math.max(a, x)); + } + function lerp(a, b, t) { + return a + (b - a) * t; + } + function sstep(a, b, x) { + const t = clamp((x - a) / (b - a), 0, 1); + return t * t * (3 - 2 * t); + } + function out3(t) { + return 1 - Math.pow(1 - clamp(t, 0, 1), 3); + } + + readonly property var g: { + const p = progress, W = bodyWidth, H = bodyHeight, X = bodyX; + const panelR = Math.min(radius, W / 2, H / 2); + // Small panels (tooltips) get a smaller bead. + const bulbMax = Math.max(6, Math.min(40, W / 2 - 2, H / 2 - 2)); + const top = islandBottom - 3; + const sx = clamp(sourceX < 0 ? X + W / 2 : sourceX, X + bulbMax + 2, X + W - bulbMax - 2); + const a = out3(p / 0.4); // bead swells and sinks + const b = clamp((p - 0.3) / 0.62, 0, 1); // bead becomes the panel + const eb = out3(b); + const release = sstep(0.8, 0.95, p); // the neck lets go + const bulbR = lerp(3, bulbMax, a); + const hang = Math.max(4, Math.min(66, H - bulbMax - 2 - top)); + const beadY = top + lerp(4, hang, a); + // A small sideways swell as it settles, kept inside the ears. + const swell = Math.sin(clamp((b - 0.55) / 0.45, 0, 1) * Math.PI) * 0.03; + const halfW = Math.min(lerp(bulbR, W / 2, eb) * (1 + swell), W / 2 + X - 1); + const halfH = lerp(bulbR, H / 2, eb); + const cx = lerp(sx, X + W / 2, eb), cy = lerp(beadY, H / 2, eb); + return { + stem: Qt.vector4d(sx, top, lerp(6, 11, a) * (1 - release), lerp(bulbR * 0.9, 10, eb) * (1 - release)), + stemH: lerp(beadY, 12, eb) - top, + box: Qt.vector4d(cx, cy, halfW, halfH), + boxR: Math.min(lerp(bulbR, panelR, eb), halfW, halfH), + melt: lerp(20, 6, release), + // Only the bead is a lens; it clears before the panel takes shape. + lens: Qt.vector4d(cx, cy, Math.min(Math.max(halfW, halfH), bulbMax * 1.4), 1 - sstep(0.3, 0.52, p)) + }; + } + + // The wallpaper under this screen, for the lens. Loaded only while the drop + // is out; the pixmap cache keeps it for the next opening. + readonly property var screenObj: Quickshell.screens.find(s => s.name === screenName) || null + readonly property string wallPath: { + if (!screenName || !ConfigService.ready) + return ""; + return WallpaperService.observed[screenName] || ConfigService.data.wallpaper.byMonitor[screenName] || ""; + } + Image { + id: wallImage + visible: false + asynchronous: true + cache: true + sourceSize.width: 1280 + source: root.visible && root.wallPath ? "file://" + root.wallPath : "" + } + readonly property vector4d cover: { + const iw = wallImage.implicitWidth, ih = wallImage.implicitHeight; + const sw = screenObj ? screenObj.width : 1920, sh = screenObj ? screenObj.height : 1080; + if (iw <= 0 || ih <= 0) + return Qt.vector4d(0, 0, 0, 0); + const sc = Math.max(sw / iw, sh / ih), w = iw * sc, h = ih * sc; + return Qt.vector4d(1 / w, 1 / h, (w - sw) / 2 / w, (h - sh) / 2 / h); + } + + ShaderEffect { + anchors.fill: parent + property point size: Qt.point(width, height) + property real topY: -root.topSpace + property vector4d stem: root.g.stem + property real stemH: root.g.stemH + property vector4d box: root.g.box + property real boxR: root.g.boxR + property real melt: root.g.melt + property vector4d lens: root.g.lens + property vector4d fill: Qt.vector4d(root.fillColor.r * root.fillColor.a, root.fillColor.g * root.fillColor.a, root.fillColor.b * root.fillColor.a, root.fillColor.a) + property vector4d edge: Qt.vector4d(root.borderColor.r * root.borderColor.a, root.borderColor.g * root.borderColor.a, root.borderColor.b * root.borderColor.a, root.borderColor.a) + property vector4d cover: root.cover + property point screenOrigin: Qt.point(root.screenX, root.topSpace) + property real hasWall: wallImage.status === Image.Ready ? 1 : 0 + property var wall: wallImage + fragmentShader: Qt.resolvedUrl("shaders/notchdrop.frag.qsb") + } +} diff --git a/quickshell/components/shaders/notchdrop.frag b/quickshell/components/shaders/notchdrop.frag new file mode 100644 index 0000000..22dbda9 --- /dev/null +++ b/quickshell/components/shaders/notchdrop.frag @@ -0,0 +1,96 @@ +#version 440 +// Notch-mode panel opening (NotchDrop.qml): a glass bead swells out of the +// island under the clicked icon on a tapered neck, flips the wallpaper behind +// it like a lens, then widens into the panel and the neck lets go. +// The shape is one signed distance field: an uneven capsule (the neck) melted +// into a rounded box (bead, then panel). Geometry comes from QML per frame. +// Output is premultiplied; HyprGlass adds its blur where alpha is above its +// mask threshold, so the lens and fill sit on top of the compositor glass. +// Rebuild notchdrop.frag.qsb with scripts/build-shaders after editing. +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; + vec2 size; // item size, px + float topY; // drawer-local y of the item's top edge + vec4 stem; // neck: top x, top y, top radius, bottom radius + float stemH; // neck length + vec4 box; // bead/panel: centre x, y, half width, half height + float boxR; + float melt; // smooth-union width between neck and bead + vec4 lens; // centre x, y, radius, strength + vec4 fill; // premultiplied + vec4 edge; // premultiplied hairline + vec4 cover; // screen px -> wallpaper uv: scale xy, offset zw + vec2 screenOrigin; // screen position of drawer-local (0, 0) + float hasWall; +}; + +layout(binding = 1) uniform sampler2D wall; + +float sdBox(vec2 p, vec2 c, vec2 h, float r) { + r = min(r, min(h.x, h.y)); + vec2 q = abs(p - c) - h + r; + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r; +} +// Vertical capsule with different end radii, axis pointing down (+y). +float sdNeck(vec2 p, float r1, float r2, float h) { + h = max(h, abs(r1 - r2) + 0.5); + p.x = abs(p.x); + float b = (r1 - r2) / h; + float a = sqrt(max(1.0 - b * b, 0.0)); + float k = dot(p, vec2(-b, a)); + if (k < 0.0) + return length(p) - r1; + if (k > a * h) + return length(p - vec2(0.0, h)) - r2; + return dot(p, vec2(a, b)) - r1; +} +float smin(float a, float b, float k) { + k = max(k, 0.001); + float h = max(k - abs(a - b), 0.0) / k; + return min(a, b) - h * h * k * 0.25; +} +float scene(vec2 p) { + float n = stem.z + stem.w > 0.05 ? sdNeck(p - stem.xy, stem.z, stem.w, stemH) : 1e5; + return smin(n, sdBox(p, box.xy, box.zw, boxR), melt); +} +vec3 wallAt(vec2 p) { + return texture(wall, (p + screenOrigin) * cover.xy + cover.zw).rgb; +} + +void main() { + vec2 p = qt_TexCoord0 * size + vec2(0.0, topY); + float d = scene(p); + if (d > 1.5) { + fragColor = vec4(0.0); + return; + } + vec2 e = vec2(1.0, 0.0); + vec2 g = vec2(scene(p + e.xy) - scene(p - e.xy), scene(p + e.yx) - scene(p - e.yx)); + g = length(g) > 1e-5 ? normalize(g) : vec2(0.0, 1.0); // points outwards + float depth = clamp(-d / 16.0, 0.0, 1.0); + float rim = pow(1.0 - depth, 2.2); + + vec4 c = fill; + // The hanging bead is a lens: the wallpaper behind it, upside down. + float la = lens.w * hasWall * (1.0 - smoothstep(lens.z * 0.55, lens.z * 1.05, length(p - lens.xy))); + if (la > 0.002) { + vec2 q = lens.xy - (p - lens.xy) * 0.9 + g * rim * 10.0; + vec3 w = (wallAt(q) * 2.0 + wallAt(q + vec2(1.5, 0.0)) + wallAt(q - vec2(1.5, 0.0)) + + wallAt(q + vec2(0.0, 1.5)) + wallAt(q - vec2(0.0, 1.5))) / 6.0; + c = mix(c, vec4(w * 0.94, 1.0), la * 0.9); + } + // Light from the top left, and the bright lower lip of a drop. + float r6 = pow(1.0 - depth, 6.0); + float hl = r6 * (0.26 * max(0.0, dot(g, normalize(vec2(-0.6, -1.0)))) + + 0.42 * max(0.0, g.y) * (0.35 + 0.65 * lens.w)); + c = clamp(c + vec4(hl, hl, hl, hl * 0.6), 0.0, 1.0); + // Hairline, as the other drawers have. + float line = smoothstep(1.2, 0.0, abs(d + 0.5)); + c = mix(c, edge + c * (1.0 - edge.a), line); + + fragColor = c * clamp(0.5 - d, 0.0, 1.0) * qt_Opacity; +} diff --git a/quickshell/components/shaders/notchdrop.frag.qsb b/quickshell/components/shaders/notchdrop.frag.qsb new file mode 100644 index 0000000000000000000000000000000000000000..2469d9598b7b86d683c689d8da9f749dcfc4e28a GIT binary patch literal 7182 zcmV+p9P#4-0EWDHob5adn449x|DmOYrSe93cp$`x#(m5Q~5Y&O{q zn@x6;Y*HSao;fp(R-E;kkwfd@cB}_# z`*NBsZ){y*!eu}|Wd{fKDW}b#?&%EbP^md<^k1|cyz#8l#vA-mM&5X%k)PsSP1dN> z&kXwRcTxVW({`CN6Xfrq_5Oj>?4$bzuY2ew@O|RRt4ixl3JcON_*06RjXQt^A zJj2;y*(lP4Lln4ln!(Qm8T$Pb4o`*Y<{dt}8hF4ZB=;C3b4h``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PT-=H?oD*ak*RbfOX ze}f0Ai`#t(&aE%P#%DNR78@gc^YeB`J4NqnctgH!U8|mH2K?FE?3&v2Q#0`$KICfZ zHt0c|;b1Sgmcg^Ycg`kn6vOINEC(mMvnLmH`_|qzR6()v)VKF4_6Y+|kge|U0q>MW zQF$ZiWmys>$Jm8YLR;n0*32g=;U&NwsFd3G`=+RqPRia~CAIJQO;ICl$=?tJz)AO-AcBqk+xmANu3|8_(ur6+tKE Q<$p%nZeu?G2hHHP)Op@np8x;= literal 0 HcmV?d00001 diff --git a/quickshell/config/defaults.json b/quickshell/config/defaults.json index c13c60f..0bfd63c 100644 --- a/quickshell/config/defaults.json +++ b/quickshell/config/defaults.json @@ -277,6 +277,8 @@ "openSpeed": 100, "closeSpeed": 100, "colorSpeed": 100, + "panelOpenSpeed": 100, + "panelCloseSpeed": 100, "workspaceStyle": "bar", "islandStyle": "float" }, diff --git a/quickshell/menus/TrayMenu.qml b/quickshell/menus/TrayMenu.qml index 63540e5..9ca84d8 100644 --- a/quickshell/menus/TrayMenu.qml +++ b/quickshell/menus/TrayMenu.qml @@ -138,6 +138,7 @@ PanelWindow { drawerId: root.isRoot ? "tray" : "" screenName: root.screen ? root.screen.name : "" screenX: root.animX + sourceScreenX: root.isRoot ? root.placementCenter : -1 onHoveredChanged: if (root.isRoot) TrayService.setHovered(root, hovered) } // Shared menu body, placed in whichever surface this menu uses. diff --git a/quickshell/services/ConfigLogic.js b/quickshell/services/ConfigLogic.js index 1e87fa8..5e243c1 100644 --- a/quickshell/services/ConfigLogic.js +++ b/quickshell/services/ConfigLogic.js @@ -89,7 +89,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" || 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(typeof c.notch.glassOnOpen!=="boolean" || typeof c.notch.launcherMatch!=="boolean" || ["openSpeed","closeSpeed","colorSpeed","panelOpenSpeed","panelCloseSpeed"].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(!["float","pill","notch"].includes(c.notch.islandStyle))throw Error("Invalid notch island 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"); diff --git a/quickshell/settings/pages/Notch.qml b/quickshell/settings/pages/Notch.qml index d88c2ca..d8e9628 100644 --- a/quickshell/settings/pages/Notch.qml +++ b/quickshell/settings/pages/Notch.qml @@ -216,5 +216,24 @@ SettingsPage { step: 5 unit: "%" } + PreferenceSlider { + label: "Panel opening speed" + description: "Quick Fix, tray menus and other panels that drop out of an island" + icon: "󰖌" + setting: "notch.panelOpenSpeed" + from: 25 + to: 300 + step: 5 + unit: "%" + } + PreferenceSlider { + label: "Panel closing speed" + icon: "󰖌" + setting: "notch.panelCloseSpeed" + from: 25 + to: 300 + step: 5 + unit: "%" + } } } diff --git a/quickshell/theme/Theme.qml b/quickshell/theme/Theme.qml index 403c17c..fe5fb5f 100644 --- a/quickshell/theme/Theme.qml +++ b/quickshell/theme/Theme.qml @@ -50,6 +50,9 @@ Singleton { readonly property real notchOpenDuration: duration * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.openSpeed) : 100) readonly property real notchCloseDuration: duration * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.closeSpeed) : 100) // Docked colour to the open fill and back (only differs with "glassy when open"). + // Notch-mode panels (Quick Fix, tray menus, plugin panels): the liquid drop. + readonly property real notchPanelOpenDuration: duration * 4.2 * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.panelOpenSpeed) : 100) + readonly property real notchPanelCloseDuration: duration * 2.5 * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.panelCloseSpeed) : 100) readonly property real notchColorDuration: duration * 0.6 * 100 / (ConfigService.ready ? Math.max(25, ConfigService.data.notch.colorSpeed) : 100) // Motion inside the open notch (pages, tiles, the pill's width) uses the opening speed. readonly property real notchDuration: notchOpenDuration diff --git a/quickshell/wallpaper/WallpaperPicker.qml b/quickshell/wallpaper/WallpaperPicker.qml index 7bc0329..90896bf 100644 --- a/quickshell/wallpaper/WallpaperPicker.qml +++ b/quickshell/wallpaper/WallpaperPicker.qml @@ -123,6 +123,8 @@ PanelWindow { fillColor:root.notch ? Theme.notchOpenFill : Qt.alpha(Theme.surface,Theme.glassOpacity) openDuration:root.notch ? Theme.notchOpenDuration*2 : Theme.duration*1.8 closeDuration:root.notch ? Theme.notchCloseDuration*1.3 : Theme.duration + // The notch-shaped picker keeps the notch's own motion. + liquid:false drawerId:"wallpaper" screenName:root.screen ? root.screen.name : "" screenX:(root.screenWidth-width)/2 diff --git a/scripts/build-shaders b/scripts/build-shaders index 9cf3eb4..463ba5b 100755 --- a/scripts/build-shaders +++ b/scripts/build-shaders @@ -4,6 +4,6 @@ # nix shell nixpkgs#qt6.qtshadertools -c ./scripts/build-shaders set -eu project_dir=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) -for source in "$project_dir"/quickshell/lock/shaders/*.frag "$project_dir"/quickshell/wallpaper/shaders/*.frag; do +for source in "$project_dir"/quickshell/lock/shaders/*.frag "$project_dir"/quickshell/wallpaper/shaders/*.frag "$project_dir"/quickshell/components/shaders/*.frag; do qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o "$source.qsb" "$source" done