mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-28 09:19:52 +01: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 <153173854+FredApps@users.noreply.github.com>
This commit is contained in:
1 parent
0eede0e4a7
commit
05be8a8096
1 file changed
+4
-2
@@ -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