Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit 4f3400b

Browse files
committed
Added 'tlc' layout
1 parent 5a3f4c8 commit 4f3400b

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
3636
static const int nmaster = 1; /* number of clients in master area */
3737
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
3838

39+
#include "tlc.c"
40+
3941
static const Layout layouts[] = {
4042
/* symbol arrange function */
4143
{ "[]=", tile }, /* first entry is default */
4244
{ "><>", NULL }, /* no layout function means floating behavior */
4345
{ "[M]", monocle },
46+
{ "|||", tlc },
4447
};
4548

4649
/* Display modes of the tab bar: never shown, always shown, shown only in */

tcl.c

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
void
2+
tcl(Monitor * m)
3+
{
4+
int x, y, h, w, mw, sw, bdw;
5+
unsigned int i, n;
6+
Client * c;
7+
8+
for (n = 0, c = nexttiled(m->clients); c;
9+
c = nexttiled(c->next), n++);
10+
11+
if (n == 0)
12+
return;
13+
14+
c = nexttiled(m->clients);
15+
16+
mw = m->mfact * m->ww;
17+
sw = (m->ww - mw) / 2;
18+
bdw = (2 * c->bw);
19+
resize(c,
20+
n < 3 ? m->wx : m->wx + sw,
21+
m->wy,
22+
n == 1 ? m->ww - bdw : mw - bdw,
23+
m->wh - bdw,
24+
False);
25+
26+
if (--n == 0)
27+
return;
28+
29+
w = (m->ww - mw) / ((n > 1) + 1);
30+
c = nexttiled(c->next);
31+
32+
if (n > 1)
33+
{
34+
x = m->wx + ((n > 1) ? mw + sw : mw);
35+
y = m->wy;
36+
h = m->wh / (n / 2);
37+
38+
if (h < bh)
39+
h = m->wh;
40+
41+
for (i = 0; c && i < n / 2; c = nexttiled(c->next), i++)
42+
{
43+
resize(c,
44+
x,
45+
y,
46+
w - bdw,
47+
(i + 1 == n / 2) ? m->wy + m->wh - y - bdw : h - bdw,
48+
False);
49+
50+
if (h != m->wh)
51+
y = c->y + HEIGHT(c);
52+
}
53+
}
54+
55+
x = (n + 1 / 2) == 1 ? mw : m->wx;
56+
y = m->wy;
57+
h = m->wh / ((n + 1) / 2);
58+
59+
if (h < bh)
60+
h = m->wh;
61+
62+
for (i = 0; c; c = nexttiled(c->next), i++)
63+
{
64+
resize(c,
65+
x,
66+
y,
67+
(i + 1 == (n + 1) / 2) ? w - bdw : w - bdw,
68+
(i + 1 == (n + 1) / 2) ? m->wy + m->wh - y - bdw : h - bdw,
69+
False);
70+
71+
if (h != m->wh)
72+
y = c->y + HEIGHT(c);
73+
}
74+
}

0 commit comments

Comments
 (0)