Select gradient mode buttons by their accessibility role

This commit is contained in:
yoriswind committed 2026-11-23 10:08:56 -08:00
1 parent f7a8565ca4
commit a99db2ce13
1 file changed
+3 -1
@@ -110,7 +110,9 @@ impl Scene {
self.buttons.clear();
let update = output.platform_output.accesskit_update.as_ref().expect("AccessKit enabled");
for (_, node) in &update.nodes {
if let Some((label, bounds)) = node.label().zip(node.bounds()) {
if node.role() == egui::accesskit::Role::Button
&& let Some((label, bounds)) = node.label().zip(node.bounds())
{
self.buttons
.push((label.to_owned(), Rect::from_min_max(pos2(bounds.x0 as f32, bounds.y0 as f32), pos2(bounds.x1 as f32, bounds.y1 as f32))));
}