Use TexturedImage in MediaCache

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-02-19 17:39:46 -05:00
parent 4f4a0feb8c
commit 594ea0b42d
6 changed files with 61 additions and 34 deletions

View File

@@ -329,20 +329,22 @@ fn image_carousel(
//ui.add(egui::Spinner::new().size(spinsz));
}
// Use the previously resolved image
Some(Ok(img)) => {
let img_resp = ui.add(
Image::new(img)
.max_height(height)
.rounding(5.0)
.fit_to_original_size(1.0),
);
img_resp.context_menu(|ui| {
if ui.button("Copy Link").clicked() {
ui.ctx().copy_text(image);
ui.close_menu();
}
});
}
Some(Ok(img)) => match img {
notedeck::TexturedImage::Static(texture_handle) => {
let img_resp = ui.add(
Image::new(texture_handle)
.max_height(height)
.rounding(5.0)
.fit_to_original_size(1.0),
);
img_resp.context_menu(|ui| {
if ui.button("Copy Link").clicked() {
ui.ctx().copy_text(image);
ui.close_menu();
}
});
}
},
}
}
})