diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-03-22 06:39:17 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-03-22 06:39:17 +0100 |
commit | 3253d99365813f2d2ffd05e10cbb8c11f53d746e (patch) | |
tree | 0ab6f04d9051dc4ada1c4f977a01308227767234 /src/direct/DirectPhotoPage.vala | |
parent | e69c1b746d63bf794316669471474ab57c8cd40a (diff) |
New upstream version 0.26.0upstream/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); |