migrate to using Images instead of MediaCache directly

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-02-18 19:42:17 -05:00
parent 75a352a86f
commit 33fdf647e3
27 changed files with 101 additions and 106 deletions

View File

@@ -1,4 +1,4 @@
use notedeck::{Images, MediaCache, MediaCacheType, TexturedImage};
use notedeck::{Images, MediaCache, TexturedImage};
use crate::images::ImageType;
@@ -9,15 +9,11 @@ pub fn render_images(
images: &mut Images,
url: &str,
img_type: ImageType,
cache_type: MediaCacheType,
show_waiting: impl FnOnce(&mut egui::Ui),
show_error: impl FnOnce(&mut egui::Ui, String),
show_success: impl FnOnce(&mut egui::Ui, &str, &mut TexturedImage),
) -> egui::Response {
let cache = match cache_type.clone() {
MediaCacheType::Image => &mut images.static_imgs,
MediaCacheType::Gif => &mut images.gifs,
};
let cache = &mut images.static_imgs;
render_media_cache(
ui,