diff --git a/src/cache.rs b/src/cache.rs index 03be594..7647058 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,10 +1,8 @@ -use cairo::ImageSurface; -use glib::{timeout_future, timeout_future_seconds, ControlFlow}; +use glib::timeout_future; use gtk::gdk::Texture; -use poppler::{Document, Page}; +use poppler::Document; use std::{ collections::BTreeMap, - path::{Path, PathBuf}, rc::Rc, time::{Duration, Instant}, }; diff --git a/src/draw.rs b/src/draw.rs index 0419e9b..af45469 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -1,12 +1,8 @@ -use std::{rc::Rc, time::Instant}; +use std::rc::Rc; use cairo::{Context, ImageSurface}; use glib::Bytes; -use gtk::{ - ffi::GtkImage, - gdk::{ffi::gdk_pixbuf_get_from_surface, Texture}, - gdk_pixbuf::Pixbuf, -}; +use gtk::gdk::Texture; use poppler::Page; pub fn draw_pages_to_texture(pages: &[Rc], area_height: i32) -> Texture { diff --git a/src/ui.rs b/src/ui.rs index 59625be..df33528 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -2,23 +2,16 @@ use std::{ cell::RefCell, path::{Path, PathBuf}, rc::Rc, - time::Instant, }; use async_channel::Sender; use gtk::{ - ffi::{GtkImage, GtkPicture}, - gdk::{ffi::gdk_pixbuf_get_from_surface, Texture}, - gdk_pixbuf::{ffi::GdkPixbuf, Pixbuf}, - glib, Application, ApplicationWindow, Box, Button, DrawingArea, FileChooserAction, - FileChooserDialog, HeaderBar, Image, Label, Orientation, Picture, ResponseType, + glib, Application, ApplicationWindow, Box, Button, FileChooserAction, FileChooserDialog, + HeaderBar, Label, Orientation, Picture, ResponseType, }; -use crate::{ - cache::{self, CacheCommand, MyPageType}, - draw, -}; -use glib::{clone, Bytes}; +use crate::cache::{self, CacheCommand}; +use glib::clone; use gtk::prelude::*; pub struct Ui {