edit: Add Cancel button

This commit is contained in:
Sophie Herold 2024-09-17 22:13:35 +02:00
parent 1fc9674cb8
commit b6bdc9398d
3 changed files with 34 additions and 6 deletions

View file

@ -189,11 +189,17 @@ impl LpWindow {
about.present(Some(self));
}
pub fn show_image(&self) {
self.imp()
.stack
.set_visible_child(&*self.imp().image_window);
}
pub fn show_edit(&self) {
if let Some(image) = self.image_view().current_image() {
let edit_child = &*self.imp().edit_window_child;
edit_child.set_child(Some(&LpEditWindow::new(image)));
edit_child.set_child(Some(&LpEditWindow::new(self.clone(), image)));
self.imp().stack.set_visible_child(edit_child);
} else {
log::error!("Can't open image editor since no current image exists");