handle bitmap images

This commit is contained in:
yggverse 2025-02-13 19:19:09 +02:00
parent f2cdc7bc52
commit bcf4f44cfb
2 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,22 @@
use super::Page;
use gtk::{gdk::Texture, glib::Uri};
use std::rc::Rc;
pub enum Image {
Bitmap(Uri, Texture),
// @TODO Vector(Uri, String),
}
impl Image {
pub fn handle(&self, page: Rc<Page>) {
let uri = match self {
Self::Bitmap(uri, texture) => {
page.content.to_image(texture);
uri
}
};
page.set_title(&crate::tool::uri_to_title(uri));
page.set_progress(0.0);
page.window_action.find.simple_action.set_enabled(false);
}
}