[gnome-shell] Use a grid pattern in overlay if more than 6 windows
- From: Owen Taylor <otaylor src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-shell] Use a grid pattern in overlay if more than 6 windows
- Date: Tue, 31 Mar 2009 18:59:09 -0400 (EDT)
commit a074ef5d7c840e5ea95cae43001034cfee09772a
Author: Dave Jordan <dmj726 sbcglobal net>
Date: Tue Mar 31 16:40:18 2009 -0500
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
---
js/ui/workspaces.js | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/js/ui/workspaces.js b/js/ui/workspaces.js
index f0eefb7..37a9c1d 100644
--- a/js/ui/workspaces.js
+++ b/js/ui/workspaces.js
@@ -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);
-
- // 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;
+ // arrange the windows in a grid pattern.
+ let gridWidth = Math.ceil(Math.sqrt(numberOfWindows));
+ let gridHeight = Math.ceil(numberOfWindows / gridWidth);
+
+ 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];
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]