Skip to content

fix(prefs/macos): pad tab icons in left rail - #130

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/prefs-icon-padding-macos
Jun 12, 2026
Merged

fix(prefs/macos): pad tab icons in left rail#130
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/prefs-icon-padding-macos

Conversation

@got3nks

@got3nks got3nks commented Jun 12, 2026

Copy link
Copy Markdown

Summary

wxOSX NSTableView draws the Preferences left-rail icons flush against the cell label and bottom-anchored to the row, producing a cramped look on Mac. wxGTK / wxMSW already pad these natively, so no Linux/Windows change is wanted.

Fix

#ifdef __WXOSX__-gated padding around the 16×16 tab-icon source bitmaps in PrefsUnifiedDlg::TransferToWindow():

  • 14 px transparent right pad — visible gap between icon and label.
  • 9 px transparent bottom pad — with the icon pinned to the bitmap's top, NSTableView's vertical centering then lifts the visible icon to sit alongside the text baseline instead of dropping to the row bottom.

The wxImageList width / height grow accordingly. On wxGTK / wxMSW the #ifdef selects pad values of 0, the padIcon lambda short-circuits to a no-op return src, and the image list stays at the original 16×16 — so the change is mechanically a no-op outside Mac.

Test plan

  • macOS arm64 (system dark mode): icons in Preferences left rail have visible spacing to labels and sit vertically centered against text baseline.
  • Ubuntu 26.04 ARM64 (wxGTK3) — amule rebuilt cleanly on amule-dev-vm, Preferences left rail visually unchanged from master.
  • CI build matrix.

wxOSX NSTableView draws the row image flush against the cell label,
giving the Preferences left-rail tab icons no visible breathing room.
wxGTK and wxMSW each insert a few pixels of native padding between the
image and the text in wxLC_REPORT mode.

Widen the image list from 16x16 to 24x16 and right-pad each source
bitmap with 8 transparent pixels via wxImage::Size before adding to
the list. The extra transparent column is invisible on wxGTK/wxMSW
(row background bleeds through) so the change is platform-uniform
without an #ifdef.
@got3nks
got3nks merged commit f5d7654 into amule-org:master Jun 12, 2026
10 checks passed
@got3nks
got3nks deleted the fix/prefs-icon-padding-macos branch June 12, 2026 18:21
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