Align lower line of bar decoration to border width
Patch status: merged
Patch by Mats
Long description:
In normal border style, two horizontal lines are drawn to outline the bar decoration. The lower line leaves a gap to the left and right to align with the border. This gap was hardcoded to 2 pixels. Now it matches the current border width, if any. In stacked layout, only the bottommost bar is aligned. In tabbed layout, no gaps are left in order to close the outline and make the notion of a tab more clear.
To apply this patch, use:
curl http://cr.i3wm.org/patch/633/raw.patch | git am
b/src/x.c
21 |
@@ -473,12 +473,12 @@ void x_draw_decoration(Con *con) { |
22 |
/* 5: draw two unconnected horizontal lines in border color */ |
23 |
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border}); |
24 |
Rect *dr = &(con->deco_rect); |
25 |
- int deco_diff_l = 2; |
26 |
- int deco_diff_r = 2; |
27 |
- if (parent->layout == L_TABBED) { |
28 |
- if (TAILQ_PREV(con, nodes_head, nodes) != NULL) |
29 |
+ adjacent_t borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders; |
30 |
+ int deco_diff_l = borders_to_hide & ADJ_LEFT_SCREEN_EDGE ? 0 : con->current_border_width; |
31 |
+ int deco_diff_r = borders_to_hide & ADJ_RIGHT_SCREEN_EDGE ? 0 : con-> current_border_width; |
32 |
+ if (parent->layout == L_TABBED || |
33 |
+ (parent->layout == L_STACKED && TAILQ_NEXT(con, nodes) != NULL)) { |
34 |
deco_diff_l = 0; |
35 |
- if (TAILQ_NEXT(con, nodes) != NULL) |
36 |
deco_diff_r = 0; |
37 |
} |
38 |
xcb_segment_t segments[] = { |