diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-03-22 06:40:44 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-03-22 06:40:44 +0100 |
commit | 8e1c5a834469d804d28ee8ab2cbe2da8e600a789 (patch) | |
tree | b9771456583eaead893cfd8f02e680b58a3da970 /src/direct/DirectPhotoPage.vala | |
parent | 80a5f2d8b095e895a5424f90b2ce4684d94c1a32 (diff) | |
parent | 3253d99365813f2d2ffd05e10cbb8c11f53d746e (diff) |
Merge tag 'upstream/0.26.0'
Upstream version 0.26.0
Diffstat (limited to 'src/direct/DirectPhotoPage.vala')
-rw-r--r-- | src/direct/DirectPhotoPage.vala | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala index a48f9e0..14b54bc 100644 --- a/src/direct/DirectPhotoPage.vala +++ b/src/direct/DirectPhotoPage.vala @@ -146,12 +146,24 @@ public class DirectPhotoPage : EditingHostPage { } protected override bool on_context_buttonpress(Gdk.EventButton event) { -// Gtk.Menu context_menu = (Gtk.Menu) ui.get_widget("/DirectContextMenu"); -// popup_context_menu(context_menu, event); + popup_context_menu(get_context_menu(), event); return true; } + private Gtk.Menu context_menu; + + private Gtk.Menu get_context_menu() { + if (context_menu == null) { + var model = this.builder.get_object ("DirectContextMenu") + as GLib.MenuModel; + context_menu = new Gtk.Menu.from_model (model); + context_menu.attach_to_widget (this, null); + } + + return this.context_menu; + } + private void update_zoom_menu_item_sensitivity() { set_action_sensitive("IncreaseSize", !get_zoom_state().is_max() && !get_photo_missing()); set_action_sensitive("DecreaseSize", !get_zoom_state().is_default() && !get_photo_missing()); @@ -348,8 +360,10 @@ public class DirectPhotoPage : EditingHostPage { DirectPhoto photo; DirectPhoto.global.fetch(dest, out photo, true); - DirectView tmp_view = new DirectView(photo); - view_controller.add(tmp_view); + if (!get_photo().equals(photo)) { + DirectView tmp_view = new DirectView(photo); + view_controller.add(tmp_view); + } DirectPhoto.global.reimport_photo(photo); display_mirror_of(view_controller, photo); |