summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2009-02-21 20:22:31 +0900
committerSam Spilsbury <smspillaz@gmail.com>2009-02-21 20:22:31 +0900
commit8626c76afce76ee3afa87dd1632ba31b36a48463 (patch)
tree19fa37f1a74ff35c006373c44c715b2ffbf6c533
parent7c5074ed2740560622faee623b76af3dc6972f50 (diff)
downloadtile-8626c76afce76ee3afa87dd1632ba31b36a48463.tar.gz
tile-8626c76afce76ee3afa87dd1632ba31b36a48463.tar.bz2
Working vertical and horizontal tilers
-rw-r--r--tile.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/tile.cpp b/tile.cpp
index 817e84a..434324c 100644
--- a/tile.cpp
+++ b/tile.cpp
@@ -711,6 +711,23 @@ TileScreen::horizontalTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int winWidth = workArea.width;
+ int winHeight = workArea.height / count;
+ int x = workArea.x;
+ int i = 0;
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (x, workArea.y + (i * winHeight),
+ winWidth, winHeight);
+
+ i++;
+ }
}
void
@@ -718,6 +735,23 @@ TileScreen::verticalTile (CompWindowExtents &border,
XRectangle &workArea,
int count)
{
+ int winWidth = workArea.width / count;
+ int winHeight = workArea.height;
+ int y = workArea.y;
+ int i = 0;
+
+ foreach (CompWindow *w, screen->windows ())
+ {
+ TILE_WINDOW (w);
+
+ if (!tw->tiler)
+ continue;
+
+ tw->placeWin (workArea.x + (winWidth * i),
+ y, winWidth, winHeight);
+
+ i++;
+ }
}
/* Adapated from scale.c
@@ -1047,8 +1081,8 @@ TileScreen::TileScreen (CompScreen *screen) :
tileInitiate (RestoreKey, Restore);
tileInitiate (SquareKey, Square);
tileInitiate (EvenKey, Restore);
- tileInitiate (HorizontalKey, Restore);
- tileInitiate (VerticalKey, Restore);
+ tileInitiate (HorizontalKey, Horizontal);
+ tileInitiate (VerticalKey, Vertical);
tileInitiate (ExpandKey, Restore);
tileInitiate (OrganicKey, Restore);
tileInitiate (CascadeKey, Restore);