From: Michael Stapelberg Date: Fri, 12 Nov 2010 18:37:43 +0000 (+0100) Subject: implement different border styles X-Git-Tag: tree-pr1~125 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e264cb5c41c7b314964d8b25e54076d97ed8bf8;p=i3%2Fi3 implement different border styles Wow, that actually was easy :). --- diff --git a/src/render.c b/src/render.c index 16b2cf29..469ceaa8 100644 --- a/src/render.c +++ b/src/render.c @@ -51,11 +51,12 @@ void render_con(Con *con) { /* depending on the border style, the rect of the child window * needs to be smaller */ Rect *inset = &(con->window_rect); - *inset = (Rect){0, 0, con->rect.width, con->rect.height}; - /* TODO: different border styles */ - inset->x += 2; - inset->width -= 2 * 2; - inset->height -= 2; + + if (con->border_style == BS_NORMAL) + *inset = (Rect){2, 0, con->rect.width - (2 * 2), con->rect.height - 2}; + else if (con->border_style == BS_1PIXEL) + *inset = (Rect){1, 1, con->rect.width - 2, con->rect.height - 1}; + else *inset = (Rect){0, 0, con->rect.width, con->rect.height}; /* Obey the aspect ratio, if any */ if (con->proportional_height != 0 && @@ -131,7 +132,7 @@ void render_con(Con *con) { } /* first we have the decoration, if this is a leaf node */ - if (con_is_leaf(child)) { + if (con_is_leaf(child) && child->border_style == BS_NORMAL) { printf("that child is a leaf node, subtracting deco\n"); /* TODO: make a function for relative coords? */ child->deco_rect.x = child->rect.x - con->rect.x;