Skip to content

Visible scrollbar thumb, and icons that survive a theme switch - #23

Merged
siegfriedpammer merged 2 commits into
mainfrom
scrollbar-thumb-and-theme-switch-fixes
Oct 5, 2026
Merged

siegfriedpammer merged 2 commits into
mainfrom
scrollbar-thumb-and-theme-switch-fixes

Conversation

@christophwille

Copy link
Copy Markdown
Member

Scrollbar thumb is visible against its track

The Simple theme takes a scrollbar's thumb and track from two neighbouring palette brushes. The quiet palette App.axaml restates leaves them a shade apart in Light (#F0F2F5 on #F6F7F9) and makes the pressed thumb lighter than the track, so a list that scrolls - the branches list on the start page, for one - did not show it. Dark was weak the same way.

The thumb now has a translucent mid-grey of its own, a step stronger on hover and when pressed. It applies to every scrollbar. The palette brushes are left alone because buttons, combo boxes and list hover states share them.

Checked in the running app in Light and in Dark, thumb at rest. Hover and pressed states were not captured.

Nothing goes missing across a theme switch

Two separate losses, found while checking the above in both themes.

Toolbar icons after Dark -> Light. The monochrome icons (filter, refresh, pull) stayed light grey on the light background. Images.cs cleared the dark stylesheet with Css = null, but an SvgImage with no stylesheet falls back to the one its source was last loaded with, which is the dark one. Light now sets an explicit stylesheet restating the icons' own #202020. The mechanism was read from Svg.Skia's current source rather than the pinned version; the fix was confirmed in the running app.

Text in a screenshot taken with a theme switch. A screenshot request carrying menu:Dark showed every TextBlock built from Runs - pull request titles, the second line of each row - as blank, and they stayed blank. ScreenshotWatcher rendered the window in the same tick as the command, before the layout pass; Avalonia 12.1 draws such a text block as empty in that state and its run cache keeps the empty result. This was the harness causing what it showed: switching theme from the menu never blanked anything. The watcher now calls UpdateLayout() before it renders.

Checked by repeating the sequence that failed - menu:Dark, then menu:Light, a capture with each: text and icons are right in both themes.

Testing

dotnet build Stampeded.slnx: 0 warnings, 0 errors. The test suite was not run; it covers Stampeded.Core and all three files are in the UI project.

🤖 Generated with Claude Code

The Simple theme takes a scrollbar's thumb and track from two neighbouring
palette brushes. The quiet palette App.axaml restates leaves those a shade
apart in Light (#F0F2F5 on #F6F7F9), and the pressed thumb lighter than the
track, so a list that scrolls did not show it. Dark was weak the same way.

Retuning the palette brushes was rejected: buttons, combo boxes and list
hover states share them. The thumb gets a translucent mid-grey of its own
instead, which needs no per-theme resource and reads on both tracks.

Assisted-by: Claude:claude-fable-5-1:Claude Code
Two things went missing after switching theme, for unrelated reasons.

Going Dark and back to Light left the monochrome toolbar icons light grey on
a light background. The dark stylesheet was cleared by setting Css to null,
but an SvgImage without a stylesheet falls back to the one its source was
last loaded with - the dark one. Light now sets an explicit stylesheet that
restates the icons' own colour.

A screenshot request that switched the theme showed every text block built
from Runs as blank, and left it blank afterwards. The watcher rendered the
window in the same tick as the command, before the layout pass; Avalonia
draws such a text block as empty in that state and its run cache keeps the
empty result. The capture caused what it showed - a switch from the menu
never did this. The watcher now runs the layout pass before it renders.

Assisted-by: Claude:claude-fable-5-1:Claude Code
@siegfriedpammer
siegfriedpammer merged commit 24a99ea into main Oct 5, 2026
3 checks passed
@siegfriedpammer
siegfriedpammer deleted the scrollbar-thumb-and-theme-switch-fixes branch October 5, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants