Move Workspaces-size computation into Workspaces

svn path=/trunk/; revision=134
This commit is contained in:
Dan Winship
2008-12-22 21:50:23 +00:00
parent a168f6da42
commit 45ba65bebb
2 changed files with 20 additions and 28 deletions

View File

@ -38,25 +38,29 @@ const POSITIONS = {
// metaphor-breaking, but the alternatives are also weird.
const GRID_SPACING = 15;
function Workspaces(x, y, width, height) {
this._init(x, y, width, height);
function Workspaces() {
this._init();
}
Workspaces.prototype = {
_init : function(x, y, width, height) {
_init : function() {
let me = this;
let global = Shell.Global.get();
this.actor = new Clutter.Group();
this._x = x;
this._y = y;
this._width = width;
this._height = height;
let screenWidth = global.screen_width;
let screenHeight = global.screen_height;
this._width = screenWidth * Overlay.WORKSPACE_GRID_SCALE;
this._height = screenHeight * Overlay.WORKSPACE_GRID_SCALE;
this._x = screenWidth - this._width - Overlay.WORKSPACE_GRID_PADDING;
this._y = Panel.PANEL_HEIGHT + (screenHeight - this._height - Panel.PANEL_HEIGHT) / 2;
this._workspaces = [];
this._clones = [];
let global = Shell.Global.get();
let windows = global.get_windows();
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
let activeWorkspace;