fix(gui): scale preferences page icons on hi-DPI displays - #295
Merged
Conversation
The preferences dialog's page list (General, Connection, Directories, etc.) fed 16x16 bitmaps into a fixed-size wxImageList, so on DPI-aware builds the icons render at 16 physical pixels — tiny and blurry on hi-DPI screens, same problem as the main toolbar (amule-org#294). Hand the icons to the list control as wxBitmapBundles instead (wxListCtrl::SetSmallImages, wx >= 3.2), each built from the 16px art plus a wxIMAGE_QUALITY_HIGH 2x upscale with the mask converted to an alpha channel first. The macOS-only right/bottom padding is applied per resolution so the padded canvas keeps its proportions at 2x. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Thanks for the follow-up, @Zeyckler. Verified locally on all three platforms:
Merging this one as-is on CI green. |
2 tasks
got3nks
added a commit
that referenced
this pull request
Jul 5, 2026
Follow-up to #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).
Cflsft
pushed a commit
to Cflsft/amule
that referenced
this pull request
Jul 6, 2026
) The preferences dialog's page list (General, Connection, Directories, etc.) fed 16x16 bitmaps into a fixed-size wxImageList, so on DPI-aware builds the icons render at 16 physical pixels — tiny and blurry on hi-DPI screens, same problem as the main toolbar (amule-org#294). Hand the icons to the list control as wxBitmapBundles instead (wxListCtrl::SetSmallImages, wx >= 3.2), each built from the 16px art plus a wxIMAGE_QUALITY_HIGH 2x upscale with the mask converted to an alpha channel first. The macOS-only right/bottom padding is applied per resolution so the padded canvas keeps its proportions at 2x. Co-authored-by: Carlos Barrero <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]>
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #294: the preferences dialog's page selector (General, Connection, Directories, Servers, ...) has the same HiDPI problem the main toolbar had — its 16x16 icons go into a fixed-size
wxImageList, so on DPI-aware builds they render at 16 physical pixels: tiny and blurry on 4K/scaled displays.Same treatment as #294:
wxBitmapBundles viawxListCtrl::SetSmallImages()(available since wx 3.2, the project minimum; verified present in the v3.2.0 headers) instead ofAssignImageList.amuleSpecialXPMs, plus theCamuleArtProviderPNG for the IP2Country tab — its source is also 16x16) plus awxIMAGE_QUALITY_HIGH2x upscale, converting the transparency mask to an alpha channel first.padIcon, added for the NSTableView alignment quirks) is folded into the bundle builder and applied per resolution — the 1x canvas gets the original pads, the 2x canvas doubled pads — so the padded proportions are preserved at every scale. Off Mac the padding remains a no-op.Icon indexes passed to
InsertItemare unchanged (bundle vector order = page order, same as the old imagelist order).Test plan
wxListCtrl::SetSmallImages(const wxVector<wxBitmapBundle>&)verified present in wx 3.2.0 (include/wx/listbase.h).🤖 Generated with Claude Code