mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Improve doc-string for Image::alt_text
This commit is contained in:
@@ -278,7 +278,8 @@ impl<'a> Image<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set alt text for the image. This will be shown when the image fails to load.
|
/// Set alt text for the image. This will be shown when the image fails to load.
|
||||||
/// It will also be read to screen readers.
|
///
|
||||||
|
/// It will also be used for accessibility (e.g. read by screen readers).
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn alt_text(mut self, label: impl Into<String>) -> Self {
|
pub fn alt_text(mut self, label: impl Into<String>) -> Self {
|
||||||
self.alt_text = Some(label.into());
|
self.alt_text = Some(label.into());
|
||||||
@@ -672,7 +673,7 @@ pub fn paint_texture_load_result(
|
|||||||
rect: Rect,
|
rect: Rect,
|
||||||
show_loading_spinner: Option<bool>,
|
show_loading_spinner: Option<bool>,
|
||||||
options: &ImageOptions,
|
options: &ImageOptions,
|
||||||
alt: Option<&str>,
|
alt_text: Option<&str>,
|
||||||
) {
|
) {
|
||||||
match tlr {
|
match tlr {
|
||||||
Ok(TexturePoll::Ready { texture }) => {
|
Ok(TexturePoll::Ready { texture }) => {
|
||||||
@@ -697,9 +698,9 @@ pub fn paint_texture_load_result(
|
|||||||
0.0,
|
0.0,
|
||||||
TextFormat::simple(font_id.clone(), ui.visuals().error_fg_color),
|
TextFormat::simple(font_id.clone(), ui.visuals().error_fg_color),
|
||||||
);
|
);
|
||||||
if let Some(alt) = alt {
|
if let Some(alt_text) = alt_text {
|
||||||
job.append(
|
job.append(
|
||||||
alt,
|
alt_text,
|
||||||
ui.spacing().item_spacing.x,
|
ui.spacing().item_spacing.x,
|
||||||
TextFormat::simple(font_id, ui.visuals().text_color()),
|
TextFormat::simple(font_id, ui.visuals().text_color()),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user