Skip to content

fix(ui): theme-aware accent for stats labels (drop *wxBLUE) - #128

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/blue-text-theme-aware
Jun 12, 2026
Merged

fix(ui): theme-aware accent for stats labels (drop *wxBLUE)#128
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/blue-text-theme-aware

Conversation

@got3nks

@got3nks got3nks commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Addresses #45 (the "blue text barely readable on dark themes" cluster from ngosang's screenshots).

Fix

44 sites in muuli_wdr.cpp set SetForegroundColour(*wxBLUE) on numeric stats labels. *wxBLUE is pure RGB(0, 0, 255) — fine on a white background, barely readable on dark themes (GNOME Adwaita-dark, macOS dark mode, KDE Breeze Dark, Yaru-dark).

Mechanical sweep replaces every site with wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT) — the OS hyperlink/accent colour, which resolves to a contrast-appropriate colour per platform:

  • macOS: system accent (follows System Settings → Appearance, default blue)
  • Windows: theme accent colour
  • wxGTK: theme link colour (Adwaita uses blue on light, lighter blue on dark)

Distribution of the 44 sites:

Dialog Sites
File Details (right-click → Show file details) 18
Client Details 21
Shared Files bottom pane 3
Comment list dialog 1
Transfers pane "File sources:" counter 1

No logic change — the visual cue (stat numbers stand out from labels) is preserved; readability is restored on dark themes.

Test plan

  • macOS arm64 (system dark mode): all 44 sites use the macOS system accent, readable against dark window background.
  • Ubuntu 26.04 ARM64 (wxGTK3, dark theme): readable contrast across amule + amulegui (File Details, Client Details, Transfers pane).
  • CI build matrix.

…lour

44 sites across muuli_wdr.cpp used SetForegroundColour(*wxBLUE) for
numeric stats labels in fileDetails, clientDetails, sharedfilesBottomDlg,
commentLstDlg, and transferBottomPane. *wxBLUE is pure RGB(0,0,255),
which reads fine on a white background but is barely visible on dark
themes (GNOME Adwaita-dark, macOS dark mode, KDE Breeze Dark, Yaru-dark).

Replace with wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT) — the OS
hyperlink/accent colour. It resolves to a contrast-appropriate accent on
both light and dark themes via the platform's system-colour API:
  - macOS: system accent (default blue, follows System Settings → Appearance)
  - Windows: theme accent colour
  - wxGTK: theme link colour (Adwaita uses blue on light, lighter blue on dark)

Mechanical sweep — no logic change. The visual cue (numeric stats stand
out from labels) is preserved; readability is restored on dark themes.

Refs amule-org#45.
@got3nks
got3nks merged commit 86c9c7d into amule-org:master Jun 12, 2026
10 checks passed
@got3nks
got3nks deleted the fix/blue-text-theme-aware branch June 12, 2026 16:45
got3nks added a commit that referenced this pull request Jun 12, 2026
Adds Italian translations for the 32 strings added by the IP2Country
preferences-panel work in #113:
  - 19 short labels and log strings (source dropdown, status line,
    license-key field, attribution lines, download failure messages)
  - 7 fuzzy entries (Database / Source / Download URL / Auto-update /
    Custom source / Status: Loaded%s / Status: Loaded%s - %s) that
    msgmerge had guessed from neighbouring strings; corrected + de-fuzzed.
  - 3 multi-line sub-panel description blocks (DB-IP, MaxMind, Custom URL)
    covering attribution + licensing notices.

Tone follows the existing it.po register (Stato, Aggiorna, Scaricamento,
Sorgente). Proper nouns (DB-IP, MaxMind, GeoLite2, MMDB, License Key in
MaxMind context) kept verbatim; "Chiave di licenza" used as a standalone
field label.

After this commit: 1725 translated, 0 fuzzy, 0 untranslated.
got3nks added a commit that referenced this pull request Jun 17, 2026
PR #128 fixed the *wxBLUE sweep in muuli_wdr.cpp's dialog stat labels
but didn't touch the custom DC drawing inside the list controls. Two
classes of bug were left in src/GenericClientListCtrl.cpp and
src/SearchListCtrl.cpp:

1. Hardcoded text / pen colours that render fine on the default light
   theme but are unreadable on Adwaita-dark / macOS dark / KDE Breeze
   Dark.

2. SearchListCtrl's state-coding logic that overlays per-channel tints
   (`green = 255` for DOWNLOADED, `red = 255` for QUEUED, ...) on top
   of a base initialised from wxSYS_COLOUR_WINDOWTEXT. On light themes
   the base is black so the tints produce green / red / magenta as
   intended; on dark themes the base is white-ish, so the channel
   assignments are no-ops and *every state collapses to the same
   colour* -- the semantic cue disappears entirely.

Five sites updated:

  - GenericClientListCtrl.cpp:1004 + :1008 (A4AF badge text + border)
    -> wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT). Pure
    decoration, no semantic meaning -- just needs to be readable.

  - GenericClientListCtrl.cpp:1042 (queue rank decreased, was *wxBLUE)
    -> hand-tuned blue per theme: (120,170,255) on dark, (0,80,200)
    on light.

  - GenericClientListCtrl.cpp:1045 (queue rank increased, was *wxRED)
    -> hand-tuned red per theme: (255,100,100) on dark, (220,0,0) on
    light.

  - GenericClientListCtrl.cpp:1130 (filename mismatch, was *wxRED)
    -> same red palette as above.

  - SearchListCtrl.cpp::362-389 (search result state palette) ->
    replace the channel-tweak logic with explicit per-state palette
    branching:
      DOWNLOADED  green   (80,220,80) / (0,160,0)
      QUEUED      red     (255,100,100) / (220,0,0)
      CANCELED    magenta (255,120,200) / (180,0,180)
      new         blue gradient by source count, inverted on dark

Primitive used at every draw / refresh site:

    const bool isDark = wxSystemSettings::GetAppearance().IsDark();

Called per-paint, not cached at startup -- a runtime theme toggle
takes effect on the next list refresh. wxSystemAppearance::IsDark()
queries:
  - macOS: NSAppearance bestMatchFromAppearancesWithNames against the
    dark aqua appearance.
  - Windows: AppsUseLightTheme registry value.
  - wxGTK: gtk-application-prefer-dark-theme, with WCAG-style
    luminance of wxSYS_COLOUR_WINDOW as fallback.

Available since wxWidgets 3.1.3, so safely in our 3.2 minimum.

Three other call sites surveyed and intentionally left alone:
  - CaptchaGenerator.cpp:53 (*wxBLACK on *wxWHITE_BRUSH bitmap)
    drawing onto a known-white surface; theme is irrelevant.
  - DownloadListCtrl.cpp:1035 / :1037 (wxWHITE / wxBLACK for the
    percentage label over the progress bar) contrast keyed off the
    bar's own hardcoded fill colour, not the system background.

Closes #177
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