diff options
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); |