fix: a11y nodes
This commit is contained in:
parent
f1353e1ce2
commit
ea406698bd
3 changed files with 23 additions and 18 deletions
|
|
@ -403,13 +403,8 @@ where
|
||||||
cursor: mouse::Cursor,
|
cursor: mouse::Cursor,
|
||||||
) -> iced_accessibility::A11yTree {
|
) -> iced_accessibility::A11yTree {
|
||||||
let c_layout = layout.children().next().unwrap();
|
let c_layout = layout.children().next().unwrap();
|
||||||
let c_state = state.children.get(0);
|
|
||||||
|
|
||||||
self.content.as_widget().a11y_nodes(
|
self.content.as_widget().a11y_nodes(c_layout, state, cursor)
|
||||||
c_layout,
|
|
||||||
c_state.unwrap_or(&Tree::empty()),
|
|
||||||
cursor,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn drag_destinations(
|
fn drag_destinations(
|
||||||
|
|
|
||||||
|
|
@ -334,18 +334,12 @@ where
|
||||||
tree: &Tree,
|
tree: &Tree,
|
||||||
cursor_position: mouse::Cursor,
|
cursor_position: mouse::Cursor,
|
||||||
) -> iced_accessibility::A11yTree {
|
) -> iced_accessibility::A11yTree {
|
||||||
use std::rc::Rc;
|
let state = tree.state.downcast_ref::<State>().tree.borrow();
|
||||||
|
self.content.borrow().element.as_widget().a11y_nodes(
|
||||||
let tree = tree.state.downcast_ref::<Rc<RefCell<Option<Tree>>>>();
|
layout,
|
||||||
if let Some(tree) = tree.borrow().as_ref() {
|
&*state,
|
||||||
self.content.borrow().element.as_widget().a11y_nodes(
|
cursor_position,
|
||||||
layout,
|
)
|
||||||
&tree.children[0],
|
|
||||||
cursor_position,
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
iced_accessibility::A11yTree::default()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn id(&self) -> Option<core::widget::Id> {
|
fn id(&self) -> Option<core::widget::Id> {
|
||||||
|
|
|
||||||
|
|
@ -360,6 +360,22 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn a11y_nodes(
|
||||||
|
&self,
|
||||||
|
layout: Layout<'_>,
|
||||||
|
state: &Tree,
|
||||||
|
cursor: mouse::Cursor,
|
||||||
|
) -> iced_accessibility::A11yTree {
|
||||||
|
let c_state = state.children.get(0);
|
||||||
|
|
||||||
|
let ret = self.content.as_widget().a11y_nodes(
|
||||||
|
layout,
|
||||||
|
c_state.unwrap_or(&Tree::empty()),
|
||||||
|
cursor,
|
||||||
|
);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message, Theme, Renderer> From<MouseArea<'a, Message, Theme, Renderer>>
|
impl<'a, Message, Theme, Renderer> From<MouseArea<'a, Message, Theme, Renderer>>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue