ensure current item is visible when hiding/showing some labels
authorgc <gc>
Sun, 27 Apr 2008 21:09:54 +0000 (21:09 +0000)
committergc <gc>
Sun, 27 Apr 2008 21:09:54 +0000 (21:09 +0000)
bin/booh-classifier

index 70234168afb8a45e3b73897fa1b224d44384b4df..f118b12e073e819fd60a230ebd3dbaff5c0ce9d3 100644 (file)
@@ -1482,14 +1482,12 @@ def update_visibility(entry)
     end
 end
         
-def update_all_visibilities
+def update_all_visibilities_aux
     $allentries.each { |entry|
         update_visibility(entry)
     }
     shown = $mainview.get_shown_entry
-    if shown.nil?
-        return
-    end
+    shown or return
     while shown.button && ! shown.button.visible? && shown != $allentries.last
         shown = $allentries[$allentries.index(shown) + 1]
     end 
@@ -1505,6 +1503,14 @@ def update_all_visibilities
     }
 end
 
+def update_all_visibilities
+    update_all_visibilities_aux
+    Gtk.main_iteration while Gtk.events_pending?
+    shown = $mainview.get_shown_entry
+    shown and autoscroll_if_needed(shown.button, false)
+end
+
+
 def preferences
     dialog = Gtk::Dialog.new(utf8(_("Edit preferences")),
                              $main_window,