- line_width = 1;
- for (int c = 0; c < buttoncnt; c++) {
- /* set w to the width of the label */
- w = predict_text_width(buttons[c].label);
- /* account for left/right padding, which seems to be set to 12px (total) below */
- w += logical_px(12);
- y -= logical_px(30);
- xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_button_background.colorpixel});
- close = (xcb_rectangle_t){y - w - (2 * line_width), logical_px(2), w + (2 * line_width), rect.height - logical_px(6)};
- xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &close);
-
- xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){color_border.colorpixel});
- buttons[c].x = y - w - (2 * line_width);
- buttons[c].width = w;
- xcb_point_t points2[] = {
- {y - w - (2 * line_width), (line_width / 2) + logical_px(2)},
- {y - (line_width / 2), (line_width / 2) + logical_px(2)},
- {y - (line_width / 2), (rect.height - logical_px(4) - (line_width / 2))},
- {y - w - (2 * line_width), (rect.height - logical_px(4) - (line_width / 2))},
- {y - w - (2 * line_width), (line_width / 2) + logical_px(2)}};
- xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, pixmap, pixmap_gc, 5, points2);
-
- values[0] = color_text.colorpixel;
- values[1] = color_button_background.colorpixel;
- set_font_colors(pixmap_gc, color_text, color_button_background);
- /* the x term seems to set left/right padding */
- draw_text(buttons[c].label, pixmap, pixmap_gc, NULL,
- y - w - line_width + logical_px(6),
- logical_px(4) + logical_px(3),
- rect.width - y + w + line_width - logical_px(6));
-
- y -= w;