feat: add native material backgrounds

This commit is contained in:
2026-11-09 09:52:29 +07:00
parent 8c438ed8a6
commit 7784e8d570
14 changed files with 279 additions and 36 deletions
+2 -1
View File
@@ -146,12 +146,13 @@ fn the_header_toggle_hides_its_sidebar() {
// icon-only small button: derive its center from the theme metrics.
let metrics = cx.update(|cx| cx.theme().sizes.resolve(Size::default()));
let small = cx.update(|cx| cx.theme().sizes.resolve(Size::Small));
let strip_height = cx.update(|cx| cx.theme().titlebar_height);
let region = bounds(&mut visual, "sidebar-test-left").expect("left sidebar missing");
// The Sidebar fills the content area below the strip; the toggle sits at
// the strip's trailing end, one strip height above the sidebar's top.
let toggle = point(
region.right() - metrics.dense_padding_x - small.control_height / 2.0,
region.top() - metrics.strip_height / 2.0,
region.top() - strip_height / 2.0,
);
press(&mut visual, toggle, 1);
redraw(&mut visual);