summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-02-21 23:50:44 +0900
committerSam Spilsbury <smspillaz@gmail.com>2009-02-21 23:50:44 +0900
commit8f367c5024b77e805d3c38041390acfa8b558538 (patch)
tree3506593340f9b5006b99d1e5bf4fe985faf1e904
parentc0037f683a72d6a61ae3d2340d99f66d367db569 (diff)
downloadtile-8f367c5024b77e805d3c38041390acfa8b558538.tar.gz
tile-8f367c5024b77e805d3c38041390acfa8b558538.tar.bz2
Working cascade tiler
-rw-r--r--tile.cpp28
-rw-r--r--tile.xml.in2
2 files changed, 24 insertions, 6 deletions
diff --git a/tile.cpp b/tile.cpp
index 0a5cde6..d3caee3 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -2,7 +2,7 @@
*
* Compiz tile plugin
*
- * tile.cp
+ * tile.cpp
*
* Copyright (c) 2008 Sam Spilsbury <smspillaz@gmail.com>
*
@@ -799,6 +799,24 @@ TileScreen::cascadeTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int delta = optionGetCascadeDelta ();
+ int currentX = workArea.x;
+ int currentY = workArea.y;
+ int winWidth = workArea.width - delta * (count -1);
+ int winHeight = workArea.height - delta * (count -1);
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (currentX, currentY, winWidth, winHeight);
+
+ currentX += delta;
+ currentY += delta;
+ }
}
bool
@@ -1091,16 +1109,16 @@ TileScreen::TileScreen (CompScreen *screen) :
tileInitiate (VerticalKey, Vertical);
tileInitiate (ExpandKey, Restore);
tileInitiate (OrganicKey, Restore);
- tileInitiate (CascadeKey, Restore);
+ tileInitiate (CascadeKey, Cascade);
tileInitiate (RestoreEdge, Restore);
tileInitiate (SquareEdge, Square);
tileInitiate (EvenEdge, Restore);
- tileInitiate (HorizontalEdge, Restore);
- tileInitiate (VerticalEdge, Restore);
+ tileInitiate (HorizontalEdge, Horizontal);
+ tileInitiate (VerticalEdge, Vertical);
tileInitiate (ExpandEdge, Restore);
tileInitiate (OrganicEdge, Restore);
- tileInitiate (CascadeEdge, Restore);
+ tileInitiate (CascadeEdge, Cascade);
#undef tileInitiate
}
diff --git a/tile.xml.in b/tile.xml.in
index 90d8e31..c62e08e 100644
--- a/tile.xml.in
+++ b/tile.xml.in
@@ -77,7 +77,7 @@
<_long>Tries to join the windows together when horizontal, vertical or left tiling is enabled so that when you resize a window surrounding windows resize accordingly. This may cause problems if you dont leave them enough space.</_long>
<default>false</default>
</option>
- <option name="tile_delta" type="int">
+ <option name="cascade_delta" type="int">
<_short>Cascade Delta</_short>
<_long>Distance between windows when using cascade</_long>
<default>35</default>