separator

This commit is contained in:
Sascha Kruse 2013-02-22 14:52:53 +00:00
parent ec2c23a652
commit d1fa0faefc

18
x.c
View File

@ -155,14 +155,18 @@ void x_win_draw(void)
width = MAX(w, width);
}
printf("(%d,%d)\n", width, height);
height += (g_slist_length(layouts) - 1) * settings.separator_height;
printf("(%d,%d)[%d]\n", width, height, settings.separator_height);
XResizeWindow(xctx.dc->dpy, xctx.win, width, height);
cairo_rectangle(c, 0.0, 0.0, width, height);
/* FIXME frame color */
cairo_set_source_rgb(c, 0.2, 0.2, 0.2);
cairo_fill(c);
/* FIXME text color */
cairo_set_source_rgb(c, 0.8, 0.8, 0.8);
cairo_move_to(c, 0, 0);
@ -171,11 +175,23 @@ void x_win_draw(void)
for (GSList *iter = layouts; iter; iter = iter->next) {
PangoLayout *l = iter->data;
cairo_move_to(c, 0, y);
/* FIXME text color */
cairo_set_source_rgb(c, 0.8, 0.8, 0.8);
pango_cairo_update_layout(c, l);
pango_cairo_show_layout(c, l);
int h;
pango_layout_get_pixel_size(l, NULL, &h);
y += h;
if (settings.separator_height > 0 && iter->next) {
cairo_move_to(c, 0, y + settings.separator_height / 2);
/* FIXME sep_color */
cairo_set_source_rgb(c, 0.8, 0.0, 0.0);
cairo_set_line_width(c, settings.separator_height);
cairo_line_to(c, width, y);
y += settings.separator_height;
cairo_stroke(c);
}
cairo_move_to(c, 0, y);
}
cairo_show_page(c);