chore: replace pixel metrics with rem-based sizing across ui
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

This commit is contained in:
2026-11-19 15:47:50 +07:00
parent 5a597f43c4
commit a0f69b6450
74 changed files with 897 additions and 1090 deletions
+31
View File
@@ -29,6 +29,25 @@ impl Render for Harness {
.xsmall()
.debug_selector(|| "xsmall-height-probe".to_string()),
)
.child(
Button::new("small-height-probe")
.label("Probe")
.small()
.debug_selector(|| "small-height-probe".to_string()),
)
.child(
Button::new("large-height-probe")
.label("Probe")
.large()
.debug_selector(|| "large-height-probe".to_string()),
)
.child(
Button::new("child-only-probe")
.fully_rounded(true)
.padded(false)
.child(div().size(px(24.)))
.debug_selector(|| "child-only-probe".to_string()),
)
.child(
DropdownMenu::new("icon-only-dropdown")
.icon(IconRole::More)
@@ -49,11 +68,23 @@ fn buttons_render_at_their_token_heights(cx: &mut TestAppContext) {
let xsmall = cx
.debug_bounds("xsmall-height-probe")
.expect("xsmall button laid out");
let small = cx
.debug_bounds("small-height-probe")
.expect("small button laid out");
let large = cx
.debug_bounds("large-height-probe")
.expect("large button laid out");
let icon_only = cx
.debug_bounds("icon-only-dropdown-trigger")
.expect("icon-only dropdown laid out");
let child_only = cx
.debug_bounds("child-only-probe")
.expect("child-only button laid out");
assert_eq!(medium.size.height, px(32.0));
assert_eq!(xsmall.size.height, px(20.0));
assert_eq!(small.size.height, px(28.0));
assert_eq!(large.size.height, px(40.0));
assert_eq!(icon_only.size, size(px(32.0), px(32.0)));
assert_eq!(child_only.size, size(px(32.0), px(32.0)));
}