[gnome-documents] view: use GTK_SELECTION_NONE for the views when not in selection mode



commit 5760fe72f2b105f25d5081ee4c60d3fecdc406ae
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Nov 9 15:56:32 2011 -0500

    view: use GTK_SELECTION_NONE for the views when not in selection mode
    
    Instead of GTK_SELECTION_SINGLE.
    This breaks rescrolling to the last known position when going in and out
    of a collection though.

 src/view.js |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/view.js b/src/view.js
index f124b32..1cb82f6 100644
--- a/src/view.js
+++ b/src/view.js
@@ -110,20 +110,18 @@ View.prototype = {
         this._selectedURNs = null;
         this._updateSelectionId = 0;
 
-        // setup selections
-        this.setSingleClickMode(true);
-
         // create renderers
         this.createRenderers();
 
         // setup selections view => controller
-        this.setSelectionMode(Gtk.SelectionMode.SINGLE);
         this.connectToSelectionChanged(Lang.bind(this, this._onSelectionChanged));
 
         // setup selection controller => view
         this._selectionModeId =
             Global.selectionController.connect('selection-mode-changed',
                                                Lang.bind(this, this._onSelectionModeChanged));
+        this._onSelectionModeChanged();
+
         this._queryId =
             Global.trackerController.connect('query-status-changed',
                                              Lang.bind(this, this._onQueryStatusChanged));
@@ -211,7 +209,9 @@ View.prototype = {
             }));
     },
 
-    _onSelectionModeChanged: function(controller, selectionMode) {
+    _onSelectionModeChanged: function() {
+        let selectionMode = Global.selectionController.getSelectionMode();
+
         // setup the GtkSelectionMode of the view according to whether or not
         // the view is in "selection mode"
         if (selectionMode) {
@@ -219,7 +219,7 @@ View.prototype = {
             this.setSelectionMode(Gtk.SelectionMode.MULTIPLE);
         } else {
             this.setSingleClickMode(true);
-            this.setSelectionMode(Gtk.SelectionMode.SINGLE);
+            this.setSelectionMode(Gtk.SelectionMode.NONE);
         }
     },
 



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