Skip to content

fix(gui): drop Mac padding from Preferences page icons - #307

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/prefs-hidpi-mac-pads
Jul 5, 2026
Merged

fix(gui): drop Mac padding from Preferences page icons#307
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/prefs-hidpi-mac-pads

Conversation

@got3nks

@got3nks got3nks commented Jul 5, 2026

Copy link
Copy Markdown

Bug

Follow-up to #295. On macOS, the Preferences page selector shows a visible extra horizontal gap between each icon and its label. Not present on Windows or Linux — the gap is Mac-only.

Root cause

The #ifdef __WXOSX__ right/bottom pads (14 / 9 px) added earlier were compensating for how AssignImageList + NSTableView rendered:

  • NSTableView drew the image with zero native horizontal gap → we padded 14 px on the right to insert a visible gap between icon and label.
  • NSTableView vertically centred the whole bitmap → with a 16x16 icon pinned to the top of a 16x25 canvas, the icon then aligned to the text baseline instead of dropping to the row bottom.

#295 switched to SetSmallImages(wxVector<wxBitmapBundle>). That path uses a different wxOSX render code that already inserts native icon/text spacing and centres just the icon rather than the full bitmap. The old pads are now added on top of that native spacing, producing the extra gap.

Fix

Drop the Mac-only pad values (0 on Windows/Linux, so this touches only the wxOSX path), and remove the now-dead img.Size() pass in the bundle builder. The icon canvas becomes plain 16x16 at 1x and 32x32 at 2x on every backend.

Test plan

  • macOS: Preferences page selector renders with no extra gap; icons sit at the natural offset the wx-native path picks.
  • Windows / Linux: no visible change (both pads were already 0).

Follow-up to amule-project#295: the old `#ifdef __WXOSX__` right/bottom pads (14/9)
compensated for `AssignImageList`'s NSTableView render path — zero
native icon/text gap plus vertical-centre-of-the-full-bitmap, which
made a bare 16x16 icon sit flush against the label and drift toward
the row baseline. `SetSmallImages` uses a different wxOSX path that
already inserts native icon/text spacing, so the pads now render as
visible extra whitespace between icon and label. Drop them (and the
now-dead `img.Size()` pass) so wxOSX matches Windows/Linux layout.

Verified locally: rebuilt on macOS 15 ARM64 (wxOSX Cocoa 3.3.2), page
icons now sit at the natural offset the wx-native path picks. No
change on wxGTK or wxMSW paths (both pads were already 0 there).
@got3nks
got3nks merged commit c27ed65 into amule-org:master Jul 5, 2026
13 checks passed
@got3nks
got3nks deleted the fix/prefs-hidpi-mac-pads branch July 5, 2026 11:32
Cflsft pushed a commit to Cflsft/amule that referenced this pull request Jul 6, 2026
Follow-up to amule-org#295: the old `#ifdef __WXOSX__` right/bottom pads (14/9)
compensated for `AssignImageList`'s NSTableView render path — zero
native icon/text gap plus vertical-centre-of-the-full-bitmap, which
made a bare 16x16 icon sit flush against the label and drift toward
the row baseline. `SetSmallImages` uses a different wxOSX path that
already inserts native icon/text spacing, so the pads now render as
visible extra whitespace between icon and label. Drop them (and the
now-dead `img.Size()` pass) so wxOSX matches Windows/Linux layout.

Verified locally: rebuilt on macOS 15 ARM64 (wxOSX Cocoa 3.3.2), page
icons now sit at the natural offset the wx-native path picks. No
change on wxGTK or wxMSW paths (both pads were already 0 there).
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