commit 772bfbad5f6291f03acc3908bba81944622ed5d9
parent 86026502788afb12c5c9c223b659e6dfccca29b1
Author: William Casarin <jb55@jb55.com>
Date: Fri, 6 Sep 2024 21:04:02 -0700
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>
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/app_style.rs b/src/app_style.rs
@@ -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
}
}
diff --git a/src/ui/note/contents.rs b/src/ui/note/contents.rs
@@ -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)) => {
diff --git a/src/ui/profile/picture.rs b/src/ui/profile/picture.rs
@@ -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)) => {