From 3576f83b5002f7f7ff37471a4e2e617b11dfb2a9 Mon Sep 17 00:00:00 2001 From: Raghav Krishna Date: Mon, 9 Nov 2026 19:44:12 +0530 Subject: [PATCH] Pencil: check the drawn toggle states after a tool switch (#11962) --- crates/ui-egui/src/pencil_pressure_toggles_tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/pencil_pressure_toggles_tests.rs b/crates/ui-egui/src/pencil_pressure_toggles_tests.rs index edd1a835da..4a6a2031e4 100644 --- a/crates/ui-egui/src/pencil_pressure_toggles_tests.rs +++ b/crates/ui-egui/src/pencil_pressure_toggles_tests.rs @@ -116,6 +116,10 @@ fn the_brush_keeps_its_own_pressure_flags() { h.state_mut().ui.tool = Tool::Pencil; h.run_steps(4); assert_eq!(flags(&h), (true, false), "the mixed pair came back unchanged"); + // And the bar draws that pair, not just stores it. + let on = |h: &Harness<'static, PhotocraftApp>, label: &str| h.get_by_label(label).accesskit_node().toggled() == Some(egui::accesskit::Toggled::True); + assert!(on(&h, "Always use pressure for opacity"), "the opacity toggle reads as on"); + assert!(!on(&h, "Always use pressure for size"), "the size toggle reads as off"); } #[test]