summaryrefslogtreecommitdiff
path: root/src/direct
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2019-04-28 16:46:41 +0200
committerJörg Frings-Fürst <debian@jff.email>2019-04-28 16:46:41 +0200
commit6d3354ff2e7ce13feeae1b75d94a186d86f82d89 (patch)
tree2d908584bfb663268004e19a23e02ce6c65034c5 /src/direct
parent6dd5e6966c6ec10d38d4b620a053ae262ac60d86 (diff)
parent7385922cd37e4ffe65f4af34b2795307a76670c4 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/direct')
-rw-r--r--src/direct/DirectPhotoPage.vala14
-rw-r--r--src/direct/DirectWindow.vala17
2 files changed, 17 insertions, 14 deletions
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala
index 14b54bc..8eb2e3f 100644
--- a/src/direct/DirectPhotoPage.vala
+++ b/src/direct/DirectPhotoPage.vala
@@ -218,6 +218,12 @@ public class DirectPhotoPage : EditingHostPage {
fs.close();
return true;
+ } else {
+ if (get_container() is DirectWindow) {
+ (get_container() as DirectWindow).do_fullscreen();
+
+ return true;
+ }
}
return base.on_double_click(event);
@@ -295,7 +301,7 @@ public class DirectPhotoPage : EditingHostPage {
base.update_actions(selected_count, count);
}
- private bool check_ok_to_close_photo(Photo? photo) {
+ private bool check_ok_to_close_photo(Photo? photo, bool notify = true) {
// Means we failed to load the photo for some reason. Do not block
// shutdown
if (photo == null)
@@ -307,7 +313,7 @@ public class DirectPhotoPage : EditingHostPage {
if (drop_if_dirty) {
// need to remove transformations, or else they stick around in memory (reappearing
// if the user opens the file again)
- photo.remove_all_transformations();
+ photo.remove_all_transformations(notify);
return true;
}
@@ -320,7 +326,7 @@ public class DirectPhotoPage : EditingHostPage {
_("Close _without Saving"));
if (response == Gtk.ResponseType.YES)
- photo.remove_all_transformations();
+ photo.remove_all_transformations(notify);
else if (response == Gtk.ResponseType.NO) {
if (is_writeable)
save(photo.get_file(), 0, ScaleConstraint.ORIGINAL, Jpeg.Quality.HIGH,
@@ -336,7 +342,7 @@ public class DirectPhotoPage : EditingHostPage {
}
public bool check_quit() {
- return check_ok_to_close_photo(get_photo());
+ return check_ok_to_close_photo(get_photo(), false);
}
protected override bool confirm_replace_photo(Photo? old_photo, Photo new_photo) {
diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala
index e1cbf75..9eec5b1 100644
--- a/src/direct/DirectWindow.vala
+++ b/src/direct/DirectWindow.vala
@@ -8,6 +8,8 @@ public class DirectWindow : AppWindow {
private DirectPhotoPage direct_photo_page;
public DirectWindow(File file) {
+ base();
+
direct_photo_page = new DirectPhotoPage(file);
direct_photo_page.get_view().items_altered.connect(on_photo_changed);
direct_photo_page.get_view().items_state_changed.connect(on_photo_changed);
@@ -42,6 +44,11 @@ public class DirectWindow : AppWindow {
get_display_pathname(file.get_parent()), Resources.APP_TITLE);
}
+ // Expose on_fullscreen publicly so we can call it from the DirectPhotoPage
+ public void do_fullscreen() {
+ on_fullscreen();
+ }
+
protected override void on_fullscreen() {
File file = get_direct_page().get_current_file();
@@ -74,16 +81,6 @@ public class DirectWindow : AppWindow {
return (base.delete_event != null) ? base.delete_event(event) : false;
}
- public override bool button_press_event(Gdk.EventButton event) {
- if (event.type == Gdk.EventType.2BUTTON_PRESS) {
- on_fullscreen();
-
- return true;
- }
-
- return false;
- }
-
public override bool key_press_event(Gdk.EventKey event) {
// check for an escape
if (Gdk.keyval_name(event.keyval) == "Escape") {