Repository navigation
Paint dark symbolic tray icons in the bar foreground - #14661
Conversation
MultiEffect's colorization multiplies the source's luminance by colorizationColor, so a symbolic icon with a dark fill (Adwaita's #2e3436, Cryptomator's #222222) stayed dark on a dark bar. Fill a rectangle with the foreground and mask it by the icon instead, so the icon's own colour is discarded. The mask ramps smoothly over the icon's alpha (threshold 0.5, spread 1.0) rather than the default hard cutoff, which turned every anti-aliased edge pixel opaque. The mock tray item takes its icon from the environment so the new test can publish a dark symbolic icon through a real StatusNotifierItem. The test grabs the icon itself, checks every opaque pixel is the foreground and a corner stays transparent, and skips when the output is asleep, since a grab then never returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
[Medium impact] The PR appears safe to merge; the latest test change addresses the previous finding. SummarySymbolic tray icons now use the bar foreground, regardless of their original fill color.
Reviews (2) · Last reviewed commit: "Check that a symbolic tray icon keeps so..." · Reviewed by Greptile |
The mask ramps over the icon's alpha so anti-aliased edges stay partly transparent, but the test only looked at opaque pixels and one corner, so a hard cutoff that fattens the icon still passed. Require at least one partly transparent pixel in the grab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed again against current
Second opinion from Codex Medium, which found no defect. It agreed the change is proportionate and correct for colour, theme changes and non-symbolic icons, and that the test checks the render rather than the code. That agreement may not be independent. It also pointed out something nobody has exercised yet: an icon switching between symbolic and non-symbolic names. That is the existing bug #7290 and #15240 are about. This change neither fixes it nor makes it worse, as far as either model can tell from reading the code. Those two pull requests edit the line next to this one, so whichever lands second will need a small rebase. This now waits on the maintainer. |
|
Before and after, as asked. Both were captured from the real bar on a worker VM built from the Omarchy ISO (Tokyo Night, display scale 2). The tray shows a mock tray item using Adwaita's stock
One visible difference came up while capturing. If a Codex Medium and muse-wonder (via pi, thinking high) reviewed the captures, the placeholder behaviour and the diff at this head. Neither found anything blocking. That agreement may not be independent. Both suggested noting the placeholder difference, as above. This waits on the maintainer. |
* Paint symbolic tray icons in the bar foreground through their alpha MultiEffect's colorization multiplies the source's luminance by colorizationColor, so a symbolic icon with a dark fill (Adwaita's #2e3436, Cryptomator's #222222) stayed dark on a dark bar. Fill a rectangle with the foreground and mask it by the icon instead, so the icon's own colour is discarded. The mask ramps smoothly over the icon's alpha (threshold 0.5, spread 1.0) rather than the default hard cutoff, which turned every anti-aliased edge pixel opaque. The mock tray item takes its icon from the environment so the new test can publish a dark symbolic icon through a real StatusNotifierItem. The test grabs the icon itself, checks every opaque pixel is the foreground and a corner stays transparent, and skips when the output is asleep, since a grab then never returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> * Check that a symbolic tray icon keeps soft edges The mask ramps over the icon's alpha so anti-aliased edges stay partly transparent, but the test only looked at opaque pixels and one corner, so a hard cutoff that fattens the icon still passed. Require at least one partly transparent pixel in the grab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex Medium <noreply@openai.com> (cherry picked from commit b94447f)


Symbolic tray icons with a dark fill are invisible on a dark bar. The tray recolours a
-symbolicicon withMultiEffect { colorization: 1.0; colorizationColor: root.foreground }, but colorization multiplies the source's luminance by that colour rather than replacing it, so a dark source stays dark: Cryptomator's#222222icon came out#1B1B1Bagainst a#CACCCCforeground. Adwaita's symbolic fill is dark too (#2e3436), so this is not one odd app.TrayIconnow fills a rectangle with the bar foreground and masks it by the icon, which is the approach the report proposed: the icon contributes only its shape, and the colour is always the foreground, following theme changes as before. The mask ramps over the icon's alpha (maskThresholdMin: 0.5,maskSpreadAtMin: 1.0) instead of using the default hard cutoff, which turns every anti-aliased edge pixel fully opaque and visibly fattens the icon. Non-symbolic icons take the untouchedImagepath as before. The comment oniconIsSymbolicno longer says symbolic fills are often near-white, since the dark ones are what this fixes.tray-symbolic-icon-test.shpublishes a dark symbolic icon through the existing mock StatusNotifierItem, which now takes its icon name and theme path from the environment, renders the realTraywidget and grabs that icon. Every opaque pixel must be the foreground and a corner must stay transparent, so it fails both on the current code and on a mask that paints a solid square. It skips when the output is asleep, because a grab then never returns.Reviewed by Claude Opus 5.5 and Codex Medium over three rounds; Codex's findings shaped the test, and its last round found nothing wrong.
Fixes #8159