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

@ -146,9 +146,14 @@ impl LpImage {
self.emmit_metadata_changed();
}
DecoderUpdate::Animated => {
let callback_id = self
if imp.still.get() {
// Just load the first frame
self.imp().frame_buffer.next_frame();
} else {
let callback_id = self
.add_tick_callback(glib::clone!(@weak self as obj => @default-return glib::ControlFlow::Break, move |_, clock| obj.tick_callback(clock)));
imp.tick_callback.replace(Some(callback_id));
imp.tick_callback.replace(Some(callback_id));
}
}
DecoderUpdate::UnsupportedFormat => {
self.set_unsupported(true);