implement different border styles

Wow, that actually was easy :).
This commit is contained in:
Michael Stapelberg 2010-11-12 19:37:43 +01:00
parent 66dc8883fd
commit 0e264cb5c4

View File

@ -51,11 +51,12 @@ void render_con(Con *con) {
/* depending on the border style, the rect of the child window /* depending on the border style, the rect of the child window
* needs to be smaller */ * needs to be smaller */
Rect *inset = &(con->window_rect); Rect *inset = &(con->window_rect);
*inset = (Rect){0, 0, con->rect.width, con->rect.height};
/* TODO: different border styles */ if (con->border_style == BS_NORMAL)
inset->x += 2; *inset = (Rect){2, 0, con->rect.width - (2 * 2), con->rect.height - 2};
inset->width -= 2 * 2; else if (con->border_style == BS_1PIXEL)
inset->height -= 2; *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 */ /* Obey the aspect ratio, if any */
if (con->proportional_height != 0 && 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 */ /* 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"); printf("that child is a leaf node, subtracting deco\n");
/* TODO: make a function for relative coords? */ /* TODO: make a function for relative coords? */
child->deco_rect.x = child->rect.x - con->rect.x; child->deco_rect.x = child->rect.x - con->rect.x;