[gnome-shell] workspacesView: Don't show workspace switcher when it doesn't make sense



commit 78f6dec73b087b0a69ceec1b9d928915d2279bb9
Author: Seif Lotfy <seif lotfy collabora co uk>
Date:   Fri Oct 19 13:55:18 2012 +0200

    workspacesView: Don't show workspace switcher when it doesn't make sense
    
    Hide workspace switcher if dynamic workspaces is disabled and number of
    workspaces is set to one only, since the user is bound to only one workspace
    and showing the switcher is redundant.
    
    Signed-off-by: Seif Lotfy <seif lotfy com>

 js/ui/workspacesView.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index edb636b..3832efa 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -541,6 +541,16 @@ const WorkspacesDisplay = new Lang.Class({
         this._notifyOpacityId = 0;
         this._swipeScrollBeginId = 0;
         this._swipeScrollEndId = 0;
+
+        this._settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA });
+        this._settings.connect('changed::dynamic-workspaces',
+            Lang.bind(this, this._updateSwitcherVisibility));
+    },
+
+    _updateSwitcherVisibility: function() {
+        this._thumbnailsBox.actor.visible =
+            this._settings.get_boolean('dynamic-workspaces') ||
+                global.screen.n_workspaces > 1;
     },
 
     show: function() {
@@ -563,6 +573,7 @@ const WorkspacesDisplay = new Lang.Class({
 
         this._controls.show();
         this._thumbnailsBox.show();
+        this._updateSwitcherVisibility();
 
         this._updateWorkspacesViews();
 
@@ -974,6 +985,7 @@ const WorkspacesDisplay = new Lang.Class({
         for (let i = 0; i < this._workspacesViews.length; i++)
             this._workspacesViews[i].updateWorkspaces(oldNumWorkspaces,
                                                       newNumWorkspaces);
+        this._updateSwitcherVisibility();
     },
 
     _updateZoom : function() {



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