Draw the tray icon from the real mark, and hand macOS a template #8

Merged
geusebio merged 1 commit from feature/theme-aware-icon into main 2026-08-15 13:50:55 +00:00
Owner

Closes #576.

The icon was a placeholder, and a fixed-colour one. Menu bars are themed and mostly monochrome — every other item up there is a template image that inverts with the bar — so a coloured mark sat in that row looking like a sticker.

What changed

Both icons are rendered from the brand's solo mark, the form docs/brand.md reserves for the sub-32px band a tray icon lives in, with the geometry copied from templates/_mark.html.twig in the platform repo:

regular icon.png the resting palette — green frame, red cursor
template icon-template.png the same geometry in one colour, its shape carried by the alpha channel

SetTemplateIcon(template, regular) picks per platform: macOS takes the template and redraws it in the bar's own colour, black on light and white on dark; Linux and Windows fall through to the coloured one, since StatusNotifierItem hosts do not recolour and the Windows tray's light/dark setting is a per-user registry value rather than something the icon is asked to follow.

hack/icons/render.sh rasterises from an image rather than expecting librsvg on PATH — same reasoning as hack/lint.sh: nobody installs anything, and two people regenerating get identical bytes.

Deliberately not here

  • An .ico for Windows. That tray would rather have one than a PNG; it is a separate question from theming and the file is left as it was.
  • Per-state icons — animated while deploying, badged on failure, dimmed when signed out. The plan has a table for them, they need this asset pipeline, and doing them here would bury the theming change.

go build, go vet, go test, hack/lint.sh and hack/coverage.sh all clean; captures regenerated.

Closes [#576](https://git.grey.ooo/Grey.ooo/Someones.Computer/issues/576). The icon was a placeholder, and a fixed-colour one. Menu bars are themed and mostly monochrome — every other item up there is a template image that inverts with the bar — so a coloured mark sat in that row looking like a sticker. ## What changed Both icons are rendered from the **brand's solo mark**, the form [docs/brand.md](https://git.grey.ooo/Grey.ooo/Someones.Computer/src/branch/main/docs/brand.md) reserves for the sub-32px band a tray icon lives in, with the geometry copied from `templates/_mark.html.twig` in the platform repo: | | | |---|---| | ![regular](https://git.grey.ooo/Grey.ooo/someones.computer_tray/raw/commit/fe147e0d7cfce2f9a7a419e2daf5494d686f489e/internal/tray/icon.png) `icon.png` | the resting palette — green frame, red cursor | | ![template](https://git.grey.ooo/Grey.ooo/someones.computer_tray/raw/commit/fe147e0d7cfce2f9a7a419e2daf5494d686f489e/internal/tray/icon-template.png) `icon-template.png` | the same geometry in one colour, its shape carried by the alpha channel | `SetTemplateIcon(template, regular)` picks per platform: macOS takes the template and redraws it in the bar's own colour, black on light and white on dark; Linux and Windows fall through to the coloured one, since StatusNotifierItem hosts do not recolour and the Windows tray's light/dark setting is a per-user registry value rather than something the icon is asked to follow. `hack/icons/render.sh` rasterises from an image rather than expecting librsvg on PATH — same reasoning as `hack/lint.sh`: nobody installs anything, and two people regenerating get identical bytes. ## Deliberately not here - **An .ico for Windows.** That tray would rather have one than a PNG; it is a separate question from theming and the file is left as it was. - **Per-state icons** — animated while deploying, badged on failure, dimmed when signed out. [The plan](https://git.grey.ooo/Grey.ooo/Someones.Computer/src/branch/main/docs/tray-app.md) has a table for them, they need this asset pipeline, and doing them here would bury the theming change. `go build`, `go vet`, `go test`, `hack/lint.sh` and `hack/coverage.sh` all clean; captures regenerated.
Draw the tray icon from the real mark, and hand macOS a template
All checks were successful
CI / build (pull_request) Successful in 1m27s
fe147e0d7c
The icon was a placeholder, and a fixed-colour one at that. Menu bars are
themed and mostly monochrome — every other item up there is a template image
that inverts with the bar — so a coloured mark sat in that row looking like a
sticker.

Both icons are now rendered from the brand's solo mark, the form
docs/brand.md reserves for the sub-32px band a tray icon lives in, with the
geometry copied from the platform repo's templates/_mark.html.twig. The
template is the same geometry in one colour, its shape carried by the alpha
channel: macOS throws the colour away and redraws it in the bar's own, black
on light and white on dark.

SetTemplateIcon takes both and picks per platform — the template on macOS,
the coloured one everywhere else, since StatusNotifierItem hosts do not
recolour and the Windows tray's light/dark setting is a registry value rather
than something the icon is asked to follow.

hack/icons/render.sh rasterises from an image rather than expecting librsvg
on PATH, the same reasoning as hack/lint.sh: nobody installs anything, and
two people regenerating get identical bytes.

Windows would rather have an .ico than a .png. That is a separate question
from this one and is left as it was.
Sign in to join this conversation.
No reviewers
No labels
in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grey.ooo/someones.computer_tray!8
No description provided.