mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
Report image alt text as text if widget contains no other text (#7142)
- Same as https://github.com/emilk/egui/pull/7136 but now for atomics
This commit is contained in:
@@ -42,6 +42,15 @@ impl<'a> Atoms<'a> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no text, try to find an image with alt text.
|
||||
if string.is_none() {
|
||||
string = self.iter().find_map(|a| match &a.kind {
|
||||
AtomKind::Image(image) => image.alt_text.as_deref().map(Cow::Borrowed),
|
||||
_ => None,
|
||||
});
|
||||
}
|
||||
|
||||
string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user