con->deco_rect.y + con->deco_rect.height - 1); /* to_y */
/* 5: draw the title */
- xcb_change_gc_single(conn, parent->gc, XCB_GC_BACKGROUND, color->background);
- xcb_change_gc_single(conn, parent->gc, XCB_GC_FOREGROUND, color->text);
+ i3Font *font = load_font(conn, config.font);
+ uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT;
+ uint32_t values[] = { color->text, color->background, font->id };
+ xcb_change_gc(conn, parent->gc, mask, values);
+ int text_offset_y = font->height + (con->deco_rect.height - font->height) / 2 - 1;
struct Window *win = con->window;
if (win == NULL || win->name_x == NULL) {
parent->frame,
parent->gc,
con->deco_rect.x + 2,
- con->deco_rect.y + 14, /* TODO: hardcoded */
+ con->deco_rect.y + text_offset_y,
"another container"
);
return;
parent->frame,
parent->gc,
con->deco_rect.x + 2 + indent_px,
- con->deco_rect.y + 14, /* TODO: hardcoded */
+ con->deco_rect.y + text_offset_y,
(xcb_char2b_t*)win->name_x
);
else
parent->frame,
parent->gc,
con->deco_rect.x + 2 + indent_px,
- con->deco_rect.y + 14, /* TODO: hardcoded */
+ con->deco_rect.y + text_offset_y,
win->name_x
);
}