Use a grid pattern in overlay if more than 6 windows
The diagonal arrangement currently used in the overlay when there are more than 6 windows is hard to read and hides most of the previews. Both of these issues are fixed by arranging the windows in a grid pattern. http://bugzilla.gnome.org/show_bug.cgi?id=576269
This commit is contained in:
parent
5fbc0d4a56
commit
a074ef5d7c
@ -696,16 +696,14 @@ Workspace.prototype = {
|
||||
return POSITIONS[numberOfWindows][windowIndex];
|
||||
|
||||
// If we don't have a predefined scheme for this window count,
|
||||
// overlap the windows along the diagonal of the workspace
|
||||
// (improve this!)
|
||||
let fraction = Math.sqrt(1/numberOfWindows);
|
||||
// arrange the windows in a grid pattern.
|
||||
let gridWidth = Math.ceil(Math.sqrt(numberOfWindows));
|
||||
let gridHeight = Math.ceil(numberOfWindows / gridWidth);
|
||||
|
||||
// The top window goes at the lower right - this is different from the
|
||||
// fixed position schemes where the windows are in "reading order"
|
||||
// and the top window goes at the upper left.
|
||||
let pos = (numberOfWindows - windowIndex - 1) / (numberOfWindows - 1);
|
||||
let xCenter = (fraction / 2) + (1 - fraction) * pos;
|
||||
let yCenter = xCenter;
|
||||
let fraction = Math.sqrt(.5/(gridWidth * gridHeight));
|
||||
|
||||
let xCenter = (.5 / gridWidth) + ((windowIndex) % gridWidth) / gridWidth;
|
||||
let yCenter = (.5 / gridHeight) + Math.floor((windowIndex / gridWidth)) / gridHeight;
|
||||
|
||||
return [xCenter, yCenter, fraction];
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user