[shotwell] Fix action state when switching back in library



commit 6c2eea964babf24a9901f9569a32247282cfe40c
Author: Jens Georg <mail jensge org>
Date:   Sat Dec 31 00:39:51 2016 +0100

    Fix action state when switching back in library
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776527
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/Page.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/Page.vala b/src/Page.vala
index 56e3d99..9a6549a 100644
--- a/src/Page.vala
+++ b/src/Page.vala
@@ -277,6 +277,10 @@ public abstract class Page : Gtk.ScrolledWindow {
         in_view = true;
         add_ui();
         add_actions();
+        int selected_count = get_view().get_selected_count();
+        int count = get_view().get_count();
+        init_actions(selected_count, count);
+        update_actions(selected_count, count);
         update_modifiers();
     }
     
@@ -543,6 +547,9 @@ public abstract class Page : Gtk.ScrolledWindow {
     private void on_update_actions_on_idle() {
         if (is_destroyed)
             return;
+
+        if (!this.in_view)
+            return;
         
         update_actions(get_view().get_selected_count(), get_view().get_count());
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]