You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(ui): migrate direct Button callsites to ComponentStyles helpers
Supersedes the mechanical ui.add_sized fix from the prior version of
this PR. Each primary CTA, tab switcher, and toolbar button that was
constructing Button::new(...).fill(...).min_size(...) manually now
delegates to the appropriate ComponentStyles helper. Helpers already
go through ui.add_sized after 8428fb3, so the centering bug is fixed
at the source — callsites stop carrying the boilerplate.
Accepts the DIALOG_BUTTON_MIN_SIZE (96×36) default for every callsite;
the custom widths (120×28 tabs, 160×36 send, 150×36 toolbar) are
dropped in favor of one source of truth.
Migrations by bucket:
- Primary CTA (add_primary_button / add_primary_button_enabled):
dashpay/mod.rs, my_tokens.rs (Import/Refresh), token_creator.rs
(Load Identity / Create Token / Register Token Contract / View
JSON), top_up by_platform_address.rs, send_screen.rs (2 sends),
single_key_send_screen.rs, withdraw_screen.rs, network_chooser
(Connect).
- Danger (add_danger_button): network_chooser Disconnect.
- Tab switch (primary/secondary swap): contacts_list.rs,
contact_requests.rs, transfer_screen.rs.
- Bucket 7 (custom glass-panel styling — keep direct Button, drop
.min_size and add_sized, plain ui.add): the 4 *_subscreen_chooser
panels and grovestark_screen mode tabs.
Also adds a kittest suite (tests/kittest/button_sizing.rs) that
verifies the helpers do NOT cap button max width — long labels
("Register Token Contract") grow beyond the 96px floor; short labels
("OK") stay at the floor. This locks in the correct semantics of
ui.add_sized: it treats its arg as a MAX, but egui's horizontal
layout expands frame_size to max(desired, available) in
next_frame_ignore_wrap, so content overflows upward rather than
clipping. Future reviewers can rerun the tests instead of re-reading
egui internals.
Net diff: 17 files, -214 lines.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments