From 438bfe6b34d2d3901e42f4748c529664eb8a1941 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 13 Jul 2011 02:02:42 +0200 Subject: [PATCH] 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 file changed, 12 insertions(+), 8 deletions(-) diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 1b0d571f..da847ed8 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) {