*/
void render_con(Con *con, bool render_fullscreen);
+/*
+ * Returns the height for the decorations
+ */
+int render_deco_height(void);
+
#endif
con->current_border_width = border_width;
bsr = con_border_style_rect(con);
int deco_height =
- (con->border_style == BS_NORMAL ? config.font.height + 5 : 0);
+ (con->border_style == BS_NORMAL ? render_deco_height() : 0);
con->rect.x -= bsr.x;
con->rect.y -= bsr.y;
free(name);
/* find the height for the decorations */
- int deco_height = config.font.height + 5;
+ int deco_height = render_deco_height();
DLOG("Original rect: (%d, %d) with %d x %d\n", con->rect.x, con->rect.y, con->rect.width, con->rect.height);
DLOG("Geometry = (%d, %d) with %d x %d\n", con->geometry.x, con->geometry.y, con->geometry.width, con->geometry.height);
/* 5: Subtract the deco_height in order to make the floating window appear
* at precisely the position it specified in its original geometry (which
* is what applications might remember). */
- deco_height = (con->border_style == BS_NORMAL ? config.font.height + 5 : 0);
+ deco_height = (con->border_style == BS_NORMAL ? render_deco_height() : 0);
nc->rect.y -= deco_height;
DLOG("Corrected y = %d (deco_height = %d)\n", nc->rect.y, deco_height);
* container (for debugging purposes) */
static bool show_debug_borders = false;
+/*
+ * Returns the height for the decorations
+ */
+int render_deco_height(void) {
+ int deco_height = config.font.height + 4;
+ if (config.font.height & 0x01)
+ ++deco_height;
+ return deco_height;
+}
+
/*
* Renders a container with layout L_OUTPUT. In this layout, all CT_DOCKAREAs
* get the height of their content and the remaining CT_CON gets the rest.
}
/* find the height for the decorations */
- int deco_height = config.font.height + 4;
- if (config.font.height & 0x01)
- ++deco_height;
+ int deco_height = render_deco_height();
/* precalculate the sizes to be able to correct rounding errors */
int sizes[children];