print: Use LpImage for preview

This commit is contained in:
Sophie Herold 2023-12-25 20:18:26 +01:00
parent e387d8dc66
commit 6827a9c176
9 changed files with 143 additions and 44 deletions

View file

@ -479,11 +479,15 @@ glib::wrapper! {
impl LpPrint {
pub fn new(
image: LpImage,
image1: LpImage,
parent_window: gtk::Window,
print_settings: Option<gtk::PrintSettings>,
page_setup: Option<gtk::PageSetup>,
) -> Self {
let image = LpImage::new_still();
image.set_fixed_background_color(Some(gdk::RGBA::new(0.94, 0.94, 0.94, 1.)));
let image2 = image.clone();
glib::spawn_future_local(async move { image2.load(&image1.file().unwrap()).await });
let print_settings = print_settings.unwrap_or_default();
let obj: Self = glib::Object::builder()