From 5a7a3ebefd0abdf68dc2cbcd6449981453197aaa Mon Sep 17 00:00:00 2001 From: aiongg Date: Sun, 11 Oct 2026 19:19:07 +0000 Subject: [PATCH] =?UTF-8?q?Integration:=20Control=20bar=20tests=20find=20t?= =?UTF-8?q?he=20bar's=20own=20button=20when=20Properties=20has=20one=20wit?= =?UTF-8?q?h=20the=20same=20name=20(#524=20=C3=97=20object=20controls)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui-egui/src/chrome.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index a12adeff1..4ef83ad05 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -765,8 +765,11 @@ mod tests { h.ctx.read_response(egui::Id::new(("object_control", id))).unwrap().rect } + /// The rect of the node with this label, preferring the one in the Control bar's row: the + /// Properties panel has buttons with the same names. fn rect(h: &egui_kittest::Harness<'static, test_window::Window>, label: &str) -> egui::Rect { - h.get_by_label(label).rect() + let bar = test_window::panel_rect(h, "control_bar"); + h.query_all_by_label(label).map(|n| n.rect()).find(|r| bar.y_range().contains(r.center().y)).unwrap_or_else(|| h.get_by_label(label).rect()) } /// The application bar's search field (German interface).