introduced ISTILE, which can be easily extended with other layout functions to allow reuse of setmwfact() and zoom()
8d1810c8
2 file(s) · +7 −6
| 22 | 22 | }; |
|
| 23 | 23 | ||
| 24 | 24 | /* layout(s) */ |
|
| 25 | + | #define ISTILE isarrange(tile) |
|
| 26 | + | #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ |
|
| 27 | + | #define RESIZEHINTS True /* False - respect size hints in tiled resizals */ |
|
| 28 | + | #define SNAP 32 /* snap pixel */ |
|
| 25 | 29 | Layout layouts[] = { |
|
| 26 | 30 | /* symbol function */ |
|
| 27 | 31 | { "[]=", tile }, /* first entry is default */ |
|
| 28 | 32 | { "><>", floating }, |
|
| 29 | 33 | }; |
|
| 30 | - | #define RESIZEHINTS True /* False - respect size hints in tiled resizals */ |
|
| 31 | - | #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ |
|
| 32 | - | #define SNAP 32 /* snap pixel */ |
|
| 33 | 34 | ||
| 34 | 35 | /* key definitions */ |
|
| 35 | 36 | #define MODKEY Mod1Mask |
| 341 | 341 | movemouse(c); |
|
| 342 | 342 | } |
|
| 343 | 343 | else if(ev->button == Button2) { |
|
| 344 | - | if(isarrange(tile) && !c->isfixed && c->isfloating) |
|
| 344 | + | if(ISTILE && !c->isfixed && c->isfloating) |
|
| 345 | 345 | togglefloating(NULL); |
|
| 346 | 346 | else |
|
| 347 | 347 | zoom(NULL); |
|
| 1398 | 1398 | setmwfact(const char *arg) { |
|
| 1399 | 1399 | double delta; |
|
| 1400 | 1400 | ||
| 1401 | - | if(isarrange(floating)) |
|
| 1401 | + | if(!ISTILE) |
|
| 1402 | 1402 | return; |
|
| 1403 | 1403 | /* arg handling, manipulate mwfact */ |
|
| 1404 | 1404 | if(arg == NULL) |
|
| 1850 | 1850 | zoom(const char *arg) { |
|
| 1851 | 1851 | Client *c; |
|
| 1852 | 1852 | ||
| 1853 | - | if(!sel || isarrange(floating) || sel->isfloating) |
|
| 1853 | + | if(!sel || !ISTILE || sel->isfloating) |
|
| 1854 | 1854 | return; |
|
| 1855 | 1855 | if((c = sel) == nexttiled(clients)) |
|
| 1856 | 1856 | if(!(c = nexttiled(c->next))) |
|