From a595fc7ca575de9de87f1311f3113f6fd4c6c326 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 15 Sep 2026 17:24:02 +0200 Subject: fix: give the launcher a mark for each state The pill inverts on hover, so one mark could never work: filled dark it vanished on the dark hover background, filled light it would vanish on the accent pill at rest. Both halves of that shipped, one after the other. Removing the hover rule did not help either, because the GTK theme paints its own hover shade on the button node underneath. Declining to set a background does not leave the pill alone, it leaves that shade in charge. So the mark moves out of the image module and into CSS, where a background-image can be swapped per state: dark on the accent pill at rest, light on the dark pill hovered, with the hover background set explicitly rather than left to the theme. install.sh generates both tints from one source file, so they cannot drift apart in shape. That makes the launcher a custom module, since an image module's path is read once and CSS cannot reach inside it. Its format is a single space for the usual reason: an empty one draws no widget at all. install.sh also removes the file the old image module left behind. The prune only clears dangling symlinks, and that one was written as a real file, so nothing had been removing it. Co-Authored-By: Claude Opus 5 --- styles/modules.css | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) (limited to 'styles/modules.css') diff --git a/styles/modules.css b/styles/modules.css index cac68da..9131752 100644 --- a/styles/modules.css +++ b/styles/modules.css @@ -10,28 +10,41 @@ * Launcher: the one always-coloured pill, and the desktop's identity. * * ------------------------------------------------------------------ */ -/* The mark itself is the image module's own content, so this only draws the - * pill it sits in. The horizontal padding is wider than the vertical so the - * pill reads as a capsule like its neighbours rather than a circle: an image - * module sizes to its icon, where the others size to their text. */ -#image.launcher { - background: @accent; +/* Launcher: two marks, one per state. + * + * The mark is a CSS background rather than an image module's content, which + * is what makes this possible at all: CSS can swap a background-image on + * :hover, but it cannot reach inside an image module to recolour what that + * module drew. + * + * Two files, same path, different fill: dark on the accent pill at rest, + * light on the dark pill when hovered. install.sh generates both from one + * source, so they cannot drift apart in shape. + * + * The hover background is set explicitly rather than left out. The GTK theme + * paints its own hover shade on the button node underneath, so declining to + * set one does not leave the pill alone, it leaves the shade in charge, and + * the pill went dark with the dark mark on it. That was the second version of + * this bug; the first filled the mark with @accent and drew it on the @accent + * pill. + * + * min-height is load-bearing: the label is a single space, so without it the + * background paints into a box with almost no height. */ +#custom-launcher { + background-color: @accent; + background-image: url("@CONFIG@/slackware.svg"); + background-repeat: no-repeat; + background-position: center; + background-size: 18px 18px; padding: 2px 14px; min-width: 20px; + min-height: 18px; } -/* This pill deliberately has NO hover background. - * - * The mark is a rendered image inside the module, not a CSS background, so - * CSS cannot recolour it for a hover state. It is filled with @main-bg to - * contrast against the accent pill, which means any hover that sets the - * background to @main-bg paints the mark in its own colour and the pill goes - * blank. That shipped twice: first filled with @accent on an @accent pill, - * then hovering to @main-bg with an @main-bg mark. - * - * Changing the background here at all requires a colour that contrasts with - * BOTH @accent and @main-bg, which the palette does not owe us. So the pill - * holds its colour and the cursor alone signals it is clickable. */ +#custom-launcher:hover { + background-color: @main-bg; + background-image: url("@CONFIG@/slackware-light.svg"); +} /* ---------------------------------------------- * * Clock: the only text, each with a leading icon. * -- cgit v1.2.3