[gnome-shell-extensions] workspace-indicator: show a dot next to current workspace



commit 438bfe6b34d2d3901e42f4748c529664eb8a1941
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Jul 13 02:02:42 2011 +0200

    workspace-indicator: show a dot next to current workspace
    
    In the menu, next to current workspace, show a dot, following the
    pattern of other menus in the shell. Includes more whitespace
    changes than I'd like.

 extensions/workspace-indicator/extension.js |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index 1b0d571..da847ed 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -22,6 +22,7 @@ WorkspaceIndicator.prototype = {
 	_init: function(){
 		PanelMenu.SystemStatusButton.prototype._init.call(this, 'folder');
 
+	        this._currentWorkspace = global.screen.get_active_workspace().index();
 		this.statusLabel = new St.Label({ text: this._labelText() });
 		this.actor.set_child(this.statusLabel);
 
@@ -39,14 +40,18 @@ WorkspaceIndicator.prototype = {
 	},
 
 	_updateIndicator: function() {
-		this.statusLabel.set_text(this._labelText());
+	    this.workspacesItems[this._currentWorkspace].setShowDot(false);
+	    this._currentWorkspace = global.screen.get_active_workspace().index();
+	    this.workspacesItems[this._currentWorkspace].setShowDot(true);
+
+	    this.statusLabel.set_text(this._labelText());
 	},
 
 	_labelText : function(workspaceIndex) {
-		if(workspaceIndex == undefined) {
-			workspaceIndex = global.screen.get_active_workspace().index();
-		}
-		return Meta.prefs_get_workspace_name(workspaceIndex);
+	    if(workspaceIndex == undefined) {
+		workspaceIndex = this._currentWorkspace;
+	    }
+	    return Meta.prefs_get_workspace_name(workspaceIndex);
 	},
 
 	_createWorkspacesSection : function() {
@@ -64,9 +69,8 @@ WorkspaceIndicator.prototype = {
 				this._activate(actor.workspaceId);
 			}));
 		}
-		if(i == 1) {
-			this._updateIndicator();
-		}
+
+	    this._updateIndicator();
 	},
 
 	_activate : function (index) {



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