chore: replace pixel metrics with rem-based sizing across ui
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user