Skip to content

fix(gui): consistent ED2K/Kad connect-button rows + macOS URL field height - #677

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/network-tabs-layout
Jul 28, 2026
Merged

fix(gui): consistent ED2K/Kad connect-button rows + macOS URL field height#677
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/network-tabs-layout

Conversation

@got3nks

@got3nks got3nks commented Jul 28, 2026

Copy link
Copy Markdown

Follow-up to #663, polishing the network-tab connect-button layout across platforms.

  • Consistent first row on both tabs. The Kad tab now leads with the same full-width row as the ED2K pane: the URL refresher (update button + label + URL entry) with the connect/disconnect toggle right-aligned, above the stats graph and the Bootstrap box. Previously the toggle lived inside Kad's two-column grid, so a right-aligned toggle landed mid-pane instead of at the pane edge.
  • macOS two-line URL fields fixed. The server-list and nodes-list URL entries rendered two lines tall on macOS: their rows carry an icon-bearing button (taller than a one-line field on macOS) and the entries used Expand(), which stretched them vertically to match. Switched both to CenterVertical() (still proportion 1, so they fill the row horizontally) so they stay one line.

Pure muuli_wdr.cpp sizer layout — no logic or string changes.

Built and visually verified on macOS, Windows (ARM64), and Linux (Ubuntu ARM64).

Follow-ups to amule-project#663:

- Give the Kad tab the same full-width first row as the ED2K pane: the
  nodes-list URL refresher (update button, label, URL entry) with the
  connect/disconnect toggle right-aligned, above the stats graph and the
  Bootstrap box. Previously the toggle sat inside the 2-column grid, so a
  right-aligned toggle landed mid-pane instead of at the pane edge.

- macOS rendered the server-list and nodes-list URL entries two lines
  tall: their rows carry an icon-bearing button (taller than a one-line
  field on macOS) and the entries used Expand(), which stretched them to
  match. Switch both to CenterVertical() (still proportion 1 horizontally)
  so they stay one line.
@got3nks
got3nks merged commit 3c0aba8 into amule-org:master Jul 28, 2026
14 checks passed
@got3nks
got3nks deleted the fix/network-tabs-layout branch July 28, 2026 20:26
ngosang added a commit that referenced this pull request Jul 29, 2026
…age (#685)

The Networks tab strip carried a single ConnectButton that toggled ED2K and
Kad together, while each tab had its own state-blind Connect/Disconnect
buttons. That mirrored neither the REST API (already symmetric via
POST /networks/{connect,disconnect} with {network: "ed2k"|"kad"|"both"}) nor
amulegui after #663/#677, and it meant only the global button reflected the
actual connection state.

Each network tab now owns one state-aware toggle for its own network. Colour
and label follow the real state from the SSE status_changed event — a
red/amber/green plug reading "ED2K: Connected", "Kad: Connecting…" — while the
click performs the opposite action. "connecting" counts as up, so a Kad that is
running-but-not-routing (the backend collapses that into "connecting") stays
stoppable; this matches CKadDlg::OnBnClickedDisconnectKad. There is no
confirmation dialog, matching the buttons it replaces. Disconnecting both
networks at once is no longer offered.

Kad's "Connect from known clients" button is not lost: it issued the same
EC_OP_KAD_START the toggle does, exactly as amulegui's ID_KNOWNNODECONNECT
handler is a bare StartKad() call. "Bootstrap from node" is a genuinely
different operation (EC_OP_KAD_BOOTSTRAP_FROM_IP) and is untouched, as is the
per-row connect that dials one specific server.

The page is now a single view file. servers.js, kad.js, ed2k.js and logs.js
were imported by networks.js and nothing else, so splitting them only bought a
five-request, two-wave waterfall behind the lazy route import in app.js
RouteView — the browser had to parse networks.js before it could discover the
other four. At 410 lines the merged file sits alongside preferences.js (411)
and download-detail.js (429), which are single-file multi-tab views already;
Networks was the only page split up. split-detail.js stays separate, being
shared with Downloads and Shared files.

Merging also let some duplication and dead code go:

- stat() was defined identically in kad.js and ed2k.js; one copy remains, and
  the two log panels now share a logBox() helper.
- Three data.ensureStatus() calls in the panels were no-ops. Shell already
  calls it unconditionally for every route (app.js) and it is guarded by
  statusActive, so Ed2kInfoPanel no longer needs an effect at all.
- NetworkConnectButton lives in the view rather than components.js: it is
  Networks-only, and keeping it in components.js would have shipped it
  eagerly to every page.
- app.css: the button is now a .btn, so the tool-btn-derived sizing and the
  dead .tabs-extra .conn-btn overrides are gone. The state colours and
  .tabs-extra itself stay (still used by the Downloads category filters).
- i18n: no new keys — networks_tab_ed2k/_kad and app_connect* already cover
  the label. Eight keys left with no reference are removed, and the missing
  networks_kad_conn_disabled is added; without it the Kad info panel printed
  a raw key string whenever Kad was stopped.
LSalami added a commit to LSalami/amule that referenced this pull request Jul 29, 2026
…mule-org#402)

Follow-up review feedback on amule-org#663/amule-org#677's per-tab connect/disconnect
toggle: the button/icon were too large and sat flush against the tab
strip, and since the same button occupies the same spot on both the
ED2K and Kad tabs, its label ("Disconnect") didn't say which network
it affects. Icons are now a uniform 16x16 (down from an inconsistent
32x32/16x16 mix), each row gets a top border, and the label now reads
"Connect ED2K" / "Disconnect Kad" / etc.

Also drops the global Connect/Disconnect toolbar button
(ID_BUTTONCONNECT): it lost its click handler somewhere across
amule-org#663/amule-org#677 and had been dead ever since (no EVT_TOOL binding left) --
the combined both-networks action is still reachable from the tray
icon.
LSalami added a commit to LSalami/amule that referenced this pull request Jul 29, 2026
…mule-org#402)

Follow-up review feedback on amule-org#663/amule-org#677's per-tab connect/disconnect
toggle: the button/icon were too large and sat flush against the tab
strip, and since the same button occupies the same spot on both the
ED2K and Kad tabs, its label ("Disconnect") didn't say which network
it affects. Icons are now a uniform 16x16 (down from an inconsistent
32x32/16x16 mix), each row gets a top border, and the label now reads
"Connect ED2K" / "Disconnect Kad" / etc.

Also drops the global Connect/Disconnect toolbar button
(ID_BUTTONCONNECT): it lost its click handler somewhere across
the combined both-networks action is still reachable from the tray
icon.
LSalami added a commit to LSalami/amule that referenced this pull request Jul 29, 2026
…mule-org#402)

Follow-up review feedback on amule-org#663/amule-org#677's per-tab connect/disconnect
toggle: the button/icon were too large and sat flush against the tab
strip, and since the same button occupies the same spot on both the
ED2K and Kad tabs, its label ("Disconnect") didn't say which network
it affects. Icons are now a uniform 16x16 (down from an inconsistent
32x32/16x16 mix), each row gets a top border, and the label now reads
"Connect ED2K" / "Disconnect Kad" / etc.

Also drops the global Connect/Disconnect toolbar button
(ID_BUTTONCONNECT): it lost its click handler somewhere across
the combined both-networks action is still reachable from the tray
icon.
got3nks pushed a commit that referenced this pull request Jul 29, 2026
Shrinks the per-tab connect button and names its network (Connect/Disconnect/Cancel ED2K|Kad), adds top padding to both network tabs' first row, and scales the button icon to a uniform DPI-aware size with a per-(state, size) cache.

Bitmap margins are wxOSX-only: wxMSW keeps its native font-derived default, wxGTK keeps the leading-space fallback since it has no margin support.

Kad tab redesigned to mirror the ED2K tab: the graph spans the full width with the bootstrap-from-node row beneath it, and the four-octet IP entry collapses to a single trimmed x.x.x.x field.

Drops two redundant controls: the inert global Connect toolbar button (no event binding since #663/#677) and the "Bootstrap from known clients" button, which called the same StartKad() as the Kad tab's own Connect toggle.
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