[AppSwitcher] Drop the line wrapping code.

Also rename _grid into _appsBox as grid is not an appropriate word
anymore for what this box is.

https://bugzilla.gnome.org/show_bug.cgi?id=590563
This commit is contained in:
Steve Frécinaux 2009-09-29 23:04:46 +02:00
parent fee385ba35
commit 97df305a6d

View File

@ -17,9 +17,8 @@ POPUP_BG_COLOR.from_pixel(0x00000080);
const POPUP_APPICON_BORDER_COLOR = new Clutter.Color(); const POPUP_APPICON_BORDER_COLOR = new Clutter.Color();
POPUP_APPICON_BORDER_COLOR.from_pixel(0xffffffff); POPUP_APPICON_BORDER_COLOR.from_pixel(0xffffffff);
const POPUP_GRID_SPACING = 8; const POPUP_APPS_BOX_SPACING = 8;
const POPUP_ICON_SIZE = 48; const POPUP_ICON_SIZE = 48;
const POPUP_NUM_COLUMNS = 5;
const POPUP_POINTER_SELECTION_THRESHOLD = 3; const POPUP_POINTER_SELECTION_THRESHOLD = 3;
@ -30,20 +29,18 @@ function AltTabPopup() {
AltTabPopup.prototype = { AltTabPopup.prototype = {
_init : function() { _init : function() {
this.actor = new Big.Box({ background_color : POPUP_BG_COLOR, this.actor = new Big.Box({ background_color : POPUP_BG_COLOR,
corner_radius: POPUP_GRID_SPACING, corner_radius: POPUP_APPS_BOX_SPACING,
padding: POPUP_GRID_SPACING, padding: POPUP_APPS_BOX_SPACING,
spacing: POPUP_GRID_SPACING, spacing: POPUP_APPS_BOX_SPACING,
orientation: Big.BoxOrientation.VERTICAL, orientation: Big.BoxOrientation.VERTICAL,
reactive: true }); reactive: true });
this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
// Icon grid. TODO: Investigate Nbtk.Grid once that lands. Currently this._appsBox = new Big.Box({ spacing: POPUP_APPS_BOX_SPACING,
// just implemented using a chain of Big.Box. orientation: Big.BoxOrientation.HORIZONTAL });
this._grid = new Big.Box({ spacing: POPUP_GRID_SPACING,
orientation: Big.BoxOrientation.VERTICAL });
let gcenterbox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL, let gcenterbox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
x_align: Big.BoxAlignment.CENTER }); x_align: Big.BoxAlignment.CENTER });
gcenterbox.append(this._grid, Big.BoxPackFlags.NONE); gcenterbox.append(this._appsBox, Big.BoxPackFlags.NONE);
this.actor.append(gcenterbox, Big.BoxPackFlags.NONE); this.actor.append(gcenterbox, Big.BoxPackFlags.NONE);
this._icons = []; this._icons = [];
@ -72,13 +69,7 @@ AltTabPopup.prototype = {
this._icons.push(appIcon); this._icons.push(appIcon);
this._currentWindows.push(appIcon.windows[0]); this._currentWindows.push(appIcon.windows[0]);
// Add it to the grid this._appsBox.append(appIcon.actor, Big.BoxPackFlags.NONE);
if (!this._gridRow || this._gridRow.get_children().length == POPUP_NUM_COLUMNS) {
this._gridRow = new Big.Box({ spacing: POPUP_GRID_SPACING,
orientation: Big.BoxOrientation.HORIZONTAL });
this._grid.append(this._gridRow, Big.BoxPackFlags.NONE);
}
this._gridRow.append(appIcon.actor, Big.BoxPackFlags.NONE);
}, },
show : function(initialSelection) { show : function(initialSelection) {