[gnome-boxes/gnome-3-4] Insensitive selection button on empty collection



commit c2ea4221bfd6a5e96148922cf19f08f393b44f48
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jun 6 03:50:11 2012 +0300

    Insensitive selection button on empty collection
    
    Selection button should be insensitive when collection is empty.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676669

 src/topbar.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/topbar.vala b/src/topbar.vala
index c61c0cf..c0163cc 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -96,6 +96,9 @@ private class Boxes.Topbar: Boxes.UI {
             notebook.page = TopbarPage.SELECTION;
             app.selection_mode = true;
         });
+        update_select_btn_sensitivity ();
+        app.collection.item_added.connect (update_select_btn_sensitivity);
+        app.collection.item_removed.connect (update_select_btn_sensitivity);
         toolbar_end.insert (select_btn, 1);
 
         toolbar_end.set_show_arrow (false);
@@ -149,6 +152,10 @@ private class Boxes.Topbar: Boxes.UI {
         app.state.set_key (null, "display-fullscreen", gtk_actor, "y", AnimationMode.EASE_OUT_QUAD, -(float) height, 0, 0);
     }
 
+    private void update_select_btn_sensitivity () {
+        select_btn.sensitive = app.collection.items.length != 0;
+    }
+
     private void update_selection_label () {
         var items = app.selected_items.length ();
         if (items > 0)



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