Skip to content

fix(gui): re-theme Scintilla log views on system appearance change - #570

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/log-view-theme-contrast
Jul 24, 2026
Merged

fix(gui): re-theme Scintilla log views on system appearance change#570
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/log-view-theme-contrast

Conversation

@got3nks

@got3nks got3nks commented Jul 24, 2026

Copy link
Copy Markdown

The log views were migrated to wxStyledTextCtrl (Scintilla) in #548. Scintilla paints its colours from the system theme once, in the constructor, and — unlike the native wxTextCtrl it replaced — does not follow the platform appearance on its own. A live light↔dark switch therefore left the three log panes (aMule Log, aMuleGUI Log, Server Info) stuck in the previous theme's colours while the rest of the UI re-themed. This re-applies the styles on wxEVT_SYS_COLOUR_CHANGED so the panes track the appearance. Verified on macOS — the panes now re-theme live.

It also adds a contrast guard: on macOS the window/text system colours are appearance-aware and resolved to RGB at call time, and on some wx builds they resolve with too little contrast to read, painting the log invisible (reported in #569 with a self-built wxWidgets 3.3.3). When the two come back near-identical the fix keeps the theme's background and forces a legible foreground chosen from its brightness. Windows/GTK return static, well-contrasted colours, so that branch never triggers there and their rendering is unchanged.

The log views migrated to wxStyledTextCtrl (Scintilla) in amule-project#548 paint
their colours from the system theme once, in the constructor. The native
wxTextCtrl they replaced followed the platform appearance automatically;
Scintilla does not, so a live light/dark switch left the three log panes
(aMule Log, aMuleGUI Log, Server Info) stuck in the previous theme's
colours while the rest of the UI re-themed. Re-apply the styles on
wxEVT_SYS_COLOUR_CHANGED so the panes track the appearance.

Also guard against a foreground/background that resolve with too little
contrast to read: on macOS the window/text system colours are
appearance-aware and, on some wx builds, come back near-identical, which
paints the whole log invisible (amule-project#569). When the pair is unreadable, keep
the theme's background and force a legible foreground from its
brightness. Windows/GTK return static, well-contrasted colours and are
unaffected.
@got3nks
got3nks merged commit c3c9665 into amule-org:master Jul 24, 2026
14 checks passed
@got3nks
got3nks deleted the fix/log-view-theme-contrast branch July 24, 2026 08:14
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.

1 participant