Make width of workspace switcher popup dynamic

Make the width of the workspace switcher dynamic in order to make it have the same proportions as the actual screen.

Call redraw after adding indicator to stage to avoid warning.

https://bugzilla.gnome.org/show_bug.cgi?id=610049

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
This commit is contained in:
Mads Villadsen
2010-02-16 22:34:57 +01:00
committed by Adel Gadllah
parent 059504ca70
commit b8a9eec14f
2 changed files with 6 additions and 5 deletions

View File

@ -27,14 +27,17 @@ WorkspaceSwitcherPopup.prototype = {
height: global.screen_height });
global.stage.add_actor(this.actor);
this._scaleWidth = global.screen_width / global.screen_height;
this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" });
this._list = new St.BoxLayout({ style_class: "workspace-switcher" });
this._redraw();
this._container.add(this._list);
this.actor.add_actor(this._container);
this._redraw();
this._position();
this.actor.show();
@ -55,6 +58,7 @@ WorkspaceSwitcherPopup.prototype = {
indicator = new St.Bin({ style_class: 'ws-switcher-box' });
this._list.add(indicator);
indicator.set_width(Math.round(indicator.get_height() * this._scaleWidth));
if (i < global.screen.n_workspaces - 1) {
let spacer = new St.Bin({ style_class: 'ws-switcher-spacer' });