img: remove loading spinners

This adds blank space, but it will be nice if we can improve this
by either fading in or having some shimmer effect.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2024-09-06 21:04:02 -07:00
parent 8602650278
commit 772bfbad5f
3 changed files with 6 additions and 3 deletions

View File

@ -196,6 +196,7 @@ pub fn create_themed_visuals(theme: ColorTheme, default: Visuals) -> Visuals {
width: 1.0,
color: theme.window_stroke_color,
},
image_loading_spinners: false,
..default
}
}

View File

@ -233,7 +233,8 @@ fn image_carousel(
match img_cache.map()[&image].ready() {
// Still waiting
None => {
ui.add(egui::Spinner::new().size(spinsz));
ui.allocate_space(egui::vec2(spinsz, spinsz));
//ui.add(egui::Spinner::new().size(spinsz));
}
// Failed to fetch image!
Some(Err(_err)) => {
@ -246,7 +247,8 @@ fn image_carousel(
);
img_cache.map_mut().insert(image.to_owned(), no_pfp);
// spin until next pass
ui.add(egui::Spinner::new().size(spinsz));
ui.allocate_space(egui::vec2(spinsz, spinsz));
//ui.add(egui::Spinner::new().size(spinsz));
}
// Use the previously resolved image
Some(Ok(img)) => {

View File

@ -78,7 +78,7 @@ fn render_pfp(
}
match img_cache.map()[url].ready() {
None => ui.add(egui::Spinner::new().size(ui_size)),
None => paint_circle(ui, ui_size),
// Failed to fetch profile!
Some(Err(_err)) => {