config.h, key.c: add gaps for psuedotiling

This commit is contained in:
Iris Lightshard 2021-02-24 15:50:29 -05:00
parent d06638a1eb
commit bc38a1ab32
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 10 additions and 8 deletions

View file

@ -5,6 +5,8 @@
#define GHOSTCOL 0x797979 #define GHOSTCOL 0x797979
#define BORDER 4 #define BORDER 4
#define GAPSZ 4
#define MENUBORDER 0 #define MENUBORDER 0
#define MBORDERCOL 0x000000 #define MBORDERCOL 0x000000
#define MENUFGCOL 0x797979 #define MENUFGCOL 0x797979

16
key.c
View file

@ -147,23 +147,23 @@ keypress(XKeyEvent *e)
/* half snap */ /* half snap */
if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == hcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, 0, 0, ra.width/2, ra.height); quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height - 2*GAPSZ);
if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == lcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, ra.width/2, 0, ra.width/2, ra.height); quickreshape(current, ra.width/2 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height - 2*GAPSZ);
if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == jcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, 0, ra.height/2, ra.width, ra.height/2); quickreshape(current, GAPSZ, ra.height/2 + GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == kcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, 0, 0, ra.width, ra.height/2); quickreshape(current, GAPSZ, GAPSZ, ra.width - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
/* quarter snap */ /* quarter snap */
if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == qcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, 0, 0, ra.width/2, ra.height/2); quickreshape(current, GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == wcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, 0, ra.height/2, ra.width/2, ra.height/2); quickreshape(current, GAPSZ, ra.height/2 + GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == ocode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, ra.width/2, ra.height/2, ra.width/2, ra.height/2); quickreshape(current, ra.width/2 + GAPSZ, ra.height/2 + GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == pcode && (e->state&SHORTCUTMOD) == (MODBITS))
quickreshape(current, ra.width/2, 0, ra.width/2, ra.height/2); quickreshape(current, ra.width/2 + GAPSZ, GAPSZ, ra.width/2 - 2*GAPSZ, ra.height/2 - 2*GAPSZ);
/* center snap */ /* center snap */
if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS)) if (e->keycode == ccode && (e->state&SHORTCUTMOD) == (MODBITS))