Skip to content

feat(gui): wire the ED2K/Kad Connect button through CamuleArtProvider (#675) - #732

Merged
got3nks merged 1 commit into
amule-org:masterfrom
LSalami:iconsystem-connbutimg
Jul 31, 2026
Merged

feat(gui): wire the ED2K/Kad Connect button through CamuleArtProvider (#675)#732
got3nks merged 1 commit into
amule-org:masterfrom
LSalami:iconsystem-connbutimg

Conversation

@LSalami

@LSalami LSalami commented Jul 31, 2026

Copy link
Copy Markdown

Next slice of the icon-system cleanup scoped in #675, following #725 (dead-code deletion). This one is a real migration: wiring the ED2K/Kad per-tab Connect button through CamuleArtProvider instead of raw pixel data.

What changed

connButImg() held ~300 lines of raw XPM/pixel data for the button's 3 states (off, connected, connecting), manually rescaled and cached per-DPI in ScaledConnButImg(). The SVG assets for all 3 states (toolbar_connect/toolbar_disconnect/toolbar_connecting) already existed in src/icons/ and were already compiled into icon_data.c — nothing in the tree referenced them (checked before starting: zero hits).

Mapping verified against SetConnectButtonState's existing switch, matching the icon to the action the button performs when clicked: default/off state (label "Connect") → toolbar_connect, connected (label "Disconnect") → toolbar_disconnect, connecting (label "Cancel") → toolbar_connecting.

SetConnectButtonState now calls wxArtProvider::GetBitmapBundle() directly — same pattern already used for the status bar and main toolbar icons in amuleDlg.cpp. This also removes the manual rescale-cache: CreateBitmapBundle() rasterizes the SVG straight at the requested 16x16 logical size on demand, so there's no more raster → ConvertToImageRescale round-trip to cache against.

Result

connButImg() and ScaledConnButImg() deleted entirely; 353 lines removed net.

Testing

clang-format v18 (Docker, pinned) clean. Full amule build verified on macOS after the change. Visual verification of the Connect/Cancel/Disconnect button across all 3 states on both the Servers (ED2K) and Kad tabs is still needed — I don't have a way to drive the GUI myself, screenshots/click-through would help before merge.

connButImg() carried ~300 lines of raw XPM/pixel data for the 3 states
of the per-tab Connect/Cancel/Disconnect button (ServerWnd, KadDlg),
manually rescaled and cached in ScaledConnButImg(). The SVG assets for
all 3 states (toolbar_connect/_disconnect/_connecting) already existed
in src/icons/ and were already compiled into icon_data.c, but nothing
referenced them.

Mapping verified against SetConnectButtonState's existing switch (the
button shows the icon for the action it performs): default/off state
("Connect" label) -> toolbar_connect, connected ("Disconnect" label)
-> toolbar_disconnect, connecting ("Cancel" label) -> toolbar_connecting.

SetConnectButtonState now looks the art up via wxArtProvider::
GetBitmapBundle(), same pattern already used for the status-bar and
main-toolbar icons (amuleDlg.cpp). This also drops the manual
rescale-cache: CreateBitmapBundle() rasterizes the SVG straight at the
requested 16x16 logical size on demand, so there's no more raster ->
ConvertToImage -> Rescale round-trip to cache against.

Verified via a full `amule` build (macOS) after the change, and a
clang-format v18 (Docker, pinned per project convention) pass -- diff
is otherwise clean, only the intended lines touched.
@got3nks
got3nks merged commit 7ac5758 into amule-org:master Jul 31, 2026
15 checks passed
@got3nks

got3nks commented Jul 31, 2026

Copy link
Copy Markdown

Merged. Built from the PR head and visually verified Connect → Cancel → Disconnect on both the ED2K and Kad tabs across Linux, macOS, and Windows (ARM64) — icons render correctly and at the right size on all three. Thanks @LSalami!

got3nks added a commit to LSalami/amule that referenced this pull request Jul 31, 2026
Resolves the conflict with amule-org#732, which moved the ED2K/Kad Connect button
onto CamuleArtProvider and deleted connButImg along with its size-matching
wrapper. This branch had added a wxFAIL_MSG to that bank; the function no
longer exists, so that hunk drops and the asserts on the three surviving
banks (clientImages, amuleSpecial, amuleDlgImages) are kept unchanged.
LSalami added a commit to LSalami/amule that referenced this pull request Jul 31, 2026
…ree, and tab-close icons to CamuleArtProvider

Continues the icon-system cleanup scoped in amule-org#675, independent of
amule-org#732/amule-org#733 (different files, no overlap).

- amuleDlgImages(14)/(15): the small header icons in the Friends and
  Messages tabs. Friends gets a new "amule:friends" SVG; Messages
  reuses the existing "amule:toolbar_messages" art, requested at an
  explicit 16x16 so it doesn't inherit the toolbar's 32x32 natural
  size.
- amuleDlgImages(18)/(30): the "reload list" buttons (shared files,
  ED2K server list, Kad node list) -- three call sites, one new
  "amule:reload" SVG (see below for its own history).
- amuleSpecial(1)/(2): the shared-directory tree's folder icons get
  new "amule:folder"/"amule:folder_shared" SVGs -- same shape, tinted
  orange vs. red, matching how the original raw bitmaps only differed
  by colour.
- amuleSpecial(3)/(4): the chat/search notebook tabs' close-on-hover
  icon, replaced with wx's own stock wxART_CLOSE for both states
  instead of a second bespoke asset (both were the same "X in a box"
  bitmap, differing only by a hover-highlight border colour).

reload.svg's own history, per PR review: the first hand-drawn attempt
(thin blue single arc) didn't match the original at all -- got3nks
caught it, I reconstructed the original amuleDlgImages(18) raster to
check (a thicker green double-arrow circle) and redrew closer to that,
which still wasn't good enough. Final version is AI-vectorized via
Recraft (through the Higgsfield MCP), which got3nks preferred over
further hand-drawn iterations.

src/icons/icon_data.c (the checked-in fallback used when Python3 is
absent at configure time, per amule-org#487) regenerated via embed_icons.py to
match.

Rebased onto current master (picking up amule-org#732/amule-org#733/amule-org#739, which all
touch the same amuleSpecial/amuleDlgImages functions) -- conflicts
resolved by redoing the index deletions against the current tree
rather than replaying the stale patch, since amule-org#725/amule-org#733 already moved
the surrounding line numbers.

Verified via a full amule build (macOS) and a visual check of every
call site: Friends/Messages tab headers, the ED2K server-list and Kad
node-list reload buttons, the shared-files reload button, and the
Preferences > Directory shared-folder tree.
got3nks pushed a commit that referenced this pull request Jul 31, 2026
…or tab-close (#675) (#735)

* feat(gui): migrate Friends/Messages headers, reload buttons, folder tree, and tab-close icons to CamuleArtProvider

Continues the icon-system cleanup scoped in #675, independent of
#732/#733 (different files, no overlap).

- amuleDlgImages(14)/(15): the small header icons in the Friends and
  Messages tabs. Friends gets a new "amule:friends" SVG; Messages
  reuses the existing "amule:toolbar_messages" art, requested at an
  explicit 16x16 so it doesn't inherit the toolbar's 32x32 natural
  size.
- amuleDlgImages(18)/(30): the "reload list" buttons (shared files,
  ED2K server list, Kad node list) -- three call sites, one new
  "amule:reload" SVG (see below for its own history).
- amuleSpecial(1)/(2): the shared-directory tree's folder icons get
  new "amule:folder"/"amule:folder_shared" SVGs -- same shape, tinted
  orange vs. red, matching how the original raw bitmaps only differed
  by colour.
- amuleSpecial(3)/(4): the chat/search notebook tabs' close-on-hover
  icon, replaced with wx's own stock wxART_CLOSE for both states
  instead of a second bespoke asset (both were the same "X in a box"
  bitmap, differing only by a hover-highlight border colour).

reload.svg's own history, per PR review: the first hand-drawn attempt
(thin blue single arc) didn't match the original at all -- got3nks
caught it, I reconstructed the original amuleDlgImages(18) raster to
check (a thicker green double-arrow circle) and redrew closer to that,
which still wasn't good enough. Final version is AI-vectorized via
Recraft (through the Higgsfield MCP), which got3nks preferred over
further hand-drawn iterations.

src/icons/icon_data.c (the checked-in fallback used when Python3 is
absent at configure time, per #487) regenerated via embed_icons.py to
match.

Rebased onto current master (picking up #732/#733/#739, which all
touch the same amuleSpecial/amuleDlgImages functions) -- conflicts
resolved by redoing the index deletions against the current tree
rather than replaying the stale patch, since #725/#733 already moved
the surrounding line numbers.

Verified via a full amule build (macOS) and a visual check of every
call site: Friends/Messages tab headers, the ED2K server-list and Kad
node-list reload buttons, the shared-files reload button, and the
Preferences > Directory shared-folder tree.

* fix(gui): thicker reload stroke, dedicated message-bubble icon (#735 review)

got3nks, testing #735:
- reload: arrow bodies read too thin at 16px. Regenerated via Recraft
  with an explicit thicker/bolder-stroke prompt.
- Messages panel header: reusing "amule:toolbar_messages" (the main
  toolbar's detailed gradient mascot bust) at 16x16 doesn't read as
  "messages" once shrunk that far from its 32x32 native size. Added a
  dedicated "amule:message" chat-bubble glyph instead, sized for
  legibility at 16x16 specifically, and pointed the Messages panel
  header at it instead of the toolbar art.

Folder/folder_shared and the tab-close X were already approved as-is.

Verified via a full amule build (macOS) and a visual check of both
fixes: the shared-files reload button and the Messages panel header.
@LSalami
LSalami deleted the iconsystem-connbutimg branch August 5, 2026 14:08
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.

2 participants