panel: Add a relayout() method to position the panel

Currently the panel is positioned from main.js, move that code into
a method in panel.js instead and call it from main.js, which is
consistent with what we do for the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=643064
This commit is contained in:
Florian Müllner 2011-02-23 18:56:51 +01:00
parent 885f668d53
commit 172d68d1fe
2 changed files with 8 additions and 2 deletions

View File

@ -417,8 +417,7 @@ function _relayout() {
panel.setHotCorner(corner); panel.setHotCorner(corner);
} }
panel.actor.set_position(primary.x, primary.y); panel.relayout();
panel.actor.set_size(primary.width, Panel.PANEL_HEIGHT);
overview.relayout(); overview.relayout();
// To avoid updating the position and size of the workspaces // To avoid updating the position and size of the workspaces

View File

@ -1058,6 +1058,13 @@ Panel.prototype = {
}); });
}, },
relayout: function() {
let primary = global.get_primary_monitor();
this.actor.set_position(primary.x, primary.y);
this.actor.set_size(primary.width, PANEL_HEIGHT);
},
_onTrayIconAdded: function(o, icon, role) { _onTrayIconAdded: function(o, icon, role) {
icon.height = PANEL_ICON_SIZE; icon.height = PANEL_ICON_SIZE;