layout: new file handling shell layout

Remove ShellGlobal's monitor-related methods, and have
Main.layoutManager provide that information instead. Move
Main._relayout() to LayoutManager, and have other objects connect to
the layout manager's 'monitors-changed' signal to know when the screen
geometry has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=636963
This commit is contained in:
Dan Winship
2011-06-13 09:54:05 -04:00
parent ae35d0e43c
commit 64b2b4a7d4
20 changed files with 203 additions and 266 deletions

View File

@ -56,7 +56,7 @@ WorkspaceSwitcherPopup.prototype = {
_getPreferredHeight : function (actor, forWidth, alloc) {
let children = this._list.get_children();
let primary = global.get_primary_monitor();
let primary = Main.layoutManager.primaryMonitor;
let availHeight = primary.height;
availHeight -= Main.panel.actor.height;
@ -82,7 +82,7 @@ WorkspaceSwitcherPopup.prototype = {
},
_getPreferredWidth : function (actor, forHeight, alloc) {
let primary = global.get_primary_monitor();
let primary = Main.layoutManager.primaryMonitor;
this._childWidth = Math.round(this._childHeight * primary.width / primary.height);
alloc.min_size = this._childWidth;
@ -125,7 +125,7 @@ WorkspaceSwitcherPopup.prototype = {
},
_position: function() {
let primary = global.get_primary_monitor();
let primary = Main.layoutManager.primaryMonitor;
this._container.x = primary.x + Math.floor((primary.width - this._container.width) / 2);
this._container.y = primary.y + Main.panel.actor.height +
Math.floor(((primary.height - Main.panel.actor.height) - this._container.height) / 2);