- line_width = 1;
- for (int c = 0; c < buttoncnt; c++) {
- /* TODO: make w = text extents of the label */
- w = 100;
- y -= 30;
- xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){ color_button_background });
- close = (xcb_rectangle_t){ y - w - (2 * line_width), 2, w + (2 * line_width), rect.height - 6 };
- xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &close);
-
- xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){ color_border });
- buttons[c].x = y - w - (2 * line_width);
- buttons[c].width = w;
- xcb_point_t points2[] = {
- { y - w - (2 * line_width), (line_width / 2) + 2 },
- { y - (line_width / 2), (line_width / 2) + 2 },
- { y - (line_width / 2), (rect.height - 4 - (line_width / 2)) },
- { y - w - (2 * line_width), (rect.height - 4 - (line_width / 2)) },
- { y - w - (2 * line_width), (line_width / 2) + 2 }
- };
- xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, pixmap, pixmap_gc, 5, points2);
-
- values[0] = color_text;
- values[1] = color_button_background;
- set_font_colors(pixmap_gc, color_text, color_button_background);
- draw_text(buttons[c].label, pixmap, pixmap_gc,
- y - w - line_width + 6, 4 + 3, rect.width - y + w + line_width - 6);
-
- y -= w;