[gnome-shell/workspace-thumbnails] Remove now unnecesary workspace controls



commit 7bf6a07aa843101ec8b42dff18e2df35afc663c4
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Jan 25 16:45:58 2011 -0500

    Remove now unnecesary workspace controls
    
    With automatic workspace management, explicit controls to add and remove workspaces
    are no longer necessary. Also make the workspace thumbnails match the mockups
    more closely.

 data/theme/gnome-shell.css  |    9 +++--
 js/ui/workspaceThumbnail.js |    7 +++-
 js/ui/workspacesView.js     |   68 -------------------------------------------
 3 files changed, 10 insertions(+), 74 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 4ad9c31..091ac43 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -278,18 +278,19 @@ StTooltip StLabel {
     font-size: 32px;
     font-weight: bold;
     color: #ffffff;
-    border: 2px solid rgba(128, 128, 128, 0.4);
+    border: 1px solid #424242;
     border-right: 0px;
     border-radius: 9px 0px 0px 9px;
+    background: #071524;
 }
 
 .workspace-thumbnails {
-    spacing: 8px;
-    border: 8px transparent;
+    spacing: 7px;
+    padding: 8px;
 }
 
 .workspace-thumbnail-indicator {
-    outline: 4px solid white;
+    outline: 2px solid white;
 }
 
 .add-workspace {
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index 83341a9..3d21d2c 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -11,6 +11,9 @@ const DND = imports.ui.dnd;
 const Main = imports.ui.main;
 const Workspace = imports.ui.workspace;
 
+// Fraction of original screen size for thumbnails
+let THUMBNAIL_SCALE = 1/8.;
+
 function WindowClone(realWindow) {
     this._init(realWindow);
 }
@@ -130,8 +133,8 @@ WorkspaceThumbnail.prototype = {
         this._background = new Clutter.Clone({ source: global.background_actor });
         this._group.add_actor(this._background);
 
-        this._group.set_size(global.screen_width / 10., global.screen_height / 10.);
-        this._group.set_scale(1/10., 1/10.);
+        this._group.set_size(THUMBNAIL_SCALE * global.screen_width, THUMBNAIL_SCALE * global.screen_height);
+        this._group.set_scale(THUMBNAIL_SCALE, THUMBNAIL_SCALE);
 
         let windows = global.get_window_actors().filter(this._isMyWindow, this);
 
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 669ca05..7a41ebf 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -209,12 +209,6 @@ WorkspacesView.prototype = {
             this._workspaces[i].syncStacking(stackIndices);
     },
 
-    // Handles a drop onto the (+) button; assumes the new workspace
-    // has already been added
-    acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) {
-        return this._workspaces[this._workspaces.length - 1].acceptDrop(source, dropActor, x, y, time);
-    },
-
     // Get the grid position of the active workspace.
     getActiveWorkspacePosition: function() {
         let activeWorkspaceIndex = global.screen.get_active_workspace_index();
@@ -223,37 +217,6 @@ WorkspacesView.prototype = {
         return [activeWorkspace.x, activeWorkspace.y];
     },
 
-    canAddWorkspace: function() {
-        return global.screen.n_workspaces < MAX_WORKSPACES;
-    },
-
-    addWorkspace: function() {
-        let ws = null;
-        if (!this.canAddWorkspace()) {
-            Main.overview.shellInfo.setMessage(_("Can't add a new workspace because maximum workspaces limit has been reached."));
-        } else {
-            let currentTime = global.get_current_time();
-            ws = global.screen.append_new_workspace(false, currentTime);
-        }
-
-        return ws;
-    },
-
-    canRemoveWorkspace: function() {
-        return this._getWorkspaceIndexToRemove() > 0;
-    },
-
-    removeWorkspace: function() {
-        if (!this.canRemoveWorkspace()) {
-            Main.overview.shellInfo.setMessage(_("Can't remove the first workspace."));
-            return;
-        }
-        let index = this._getWorkspaceIndexToRemove();
-        let metaWorkspace = this._workspaces[index].metaWorkspace;
-        global.screen.remove_workspace(metaWorkspace,
-                                       global.get_current_time());
-    },
-
     zoomOut: function() {
         if (this._zoomOut)
             return;
@@ -280,13 +243,6 @@ WorkspacesView.prototype = {
         return DND.DragMotionResult.CONTINUE;
     },
 
-    _acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) {
-        let ws = this.addWorkspace();
-        if (ws == null)
-            return false;
-        return this.acceptNewWorkspaceDrop(source, dropActor, x, y, time);
-    },
-
     // Compute the position, scale and opacity of the workspaces, but don't
     // actually change the actors to match
     _computeWorkspacePositions: function() {
@@ -786,14 +742,6 @@ WorkspacesDisplay.prototype = {
         controls.connect('notify::hover',
                          Lang.bind(this, this._onControlsHoverChanged));
 
-        // Add/remove workspace buttons
-        this._removeButton = new St.Button({ label: '&#8211;', // n-dash
-                                             style_class: 'remove-workspace' });
-        this._removeButton.connect('clicked', Lang.bind(this, function() {
-            this.workspacesView.removeWorkspace();
-        }));
-        controls.add(this._removeButton);
-
         this._thumbnailsBox = new St.BoxLayout({ vertical: true,
                                                  style_class: 'workspace-thumbnails' });
         controls.add(this._thumbnailsBox, { expand: false });
@@ -815,22 +763,6 @@ WorkspacesDisplay.prototype = {
                                                         indicator.add_constraint(constraint);
                                                     });
 
-        this._addButton = new St.Button({ label: '+',
-                                          style_class: 'add-workspace' });
-        this._addButton.connect('clicked', Lang.bind(this, function() {
-            this.workspacesView.addWorkspace();
-        }));
-        this._addButton._delegate = this._addButton;
-        this._addButton._delegate.acceptDrop = Lang.bind(this,
-            function(source, actor, x, y, time) {
-                return this.workspacesView._acceptNewWorkspaceDrop(source, actor, x, y, time);
-            });
-        this._addButton._delegate.handleDragOver = Lang.bind(this,
-            function(source, actor, x, y, time) {
-                return this.workspacesView._handleDragOverNewWorkspace(source, actor, x, y, time);
-            });
-        controls.add(this._addButton, { expand: true });
-
         this.workspacesView = null;
 
         this._inDrag = false;



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