use gtk::{gdk::Texture, glib::Uri};
pub enum Image {
Bitmap(Uri, Texture),
}
impl Image {
pub fn handle(&self, page: &super::Page) {
page.navigation
.request
.info
.borrow_mut()
.add_event("Rendering".to_string());
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.snap_history();
page.window_action.find.simple_action.set_enabled(false);
page.navigation
.request
.info
.borrow_mut()
.add_event("Rendered".to_string());
}
}