components: Set default accessible role of Avatar as an image

And hide children from the a11y tree.
This commit is contained in:
Kévin Commaille 2023-11-12 12:29:03 +01:00
parent 0391911e3e
commit 9b822fb47c
No known key found for this signature in database
GPG key ID: 29A48C1F03620416

View file

@ -29,6 +29,8 @@ mod imp {
fn class_init(klass: &mut Self::Class) {
AvatarImage::static_type();
Self::bind_template(klass);
klass.set_accessible_role(gtk::AccessibleRole::Img);
}
fn instance_init(obj: &InitializingObject<Self>) {
@ -84,8 +86,14 @@ mod imp {
}
impl WidgetImpl for Avatar {}
impl BinImpl for Avatar {}
impl AccessibleImpl for Avatar {
fn first_accessible_child(&self) -> Option<gtk::Accessible> {
// Hide the children in the a11y tree.
None
}
}
}
glib::wrapper! {