mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-21 20:40:12 +00:00
Tests: aim the title bar button helper at the button's own node
The Save button's accessible label carries its tooltip text, so the label query matches the button itself on the first hover position, left of the button, and the click missed it. Return the matched node's centre instead of the hover position. Signed-off-by: FredApps <[email protected]>
This commit is contained in:
@@ -176,8 +176,10 @@ fn title_bar_button(h: &mut egui_kittest::Harness<'static, SheetApp>, name: &str
|
||||
let at = egui::pos2(x, autosave.center().y);
|
||||
h.hover_at(at);
|
||||
h.run_steps(3);
|
||||
if h.query_by_label_contains(&tip).is_some() {
|
||||
return at;
|
||||
// The button's accessible label carries its tooltip, so the node found may be the button
|
||||
// itself rather than a tooltip at the pointer: aim at the node.
|
||||
if let Some(node) = h.query_by_label_contains(&tip) {
|
||||
return node.rect().center();
|
||||
}
|
||||
x += 6.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user