mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 13:04:11 +01:00
Merge pull request #889 from thejan2009/bugfix/indicator_border
Use indicator border color only when needed.
This commit is contained in:
commit
7c166e350b
@ -108,6 +108,9 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
|
|||||||
int x = b->origin.x - g->origin.x;
|
int x = b->origin.x - g->origin.x;
|
||||||
int y = b->origin.y - g->origin.y;
|
int y = b->origin.y - g->origin.y;
|
||||||
|
|
||||||
|
// draw vertical/horizontal indicator if container is the only child of its parent container
|
||||||
|
bool is_only_child = view->parent && view->parent->children && view->parent->children->length == 1;
|
||||||
|
|
||||||
// left border
|
// left border
|
||||||
int left_border = v->origin.x - b->origin.x;
|
int left_border = v->origin.x - b->origin.x;
|
||||||
if (left_border > 0) {
|
if (left_border > 0) {
|
||||||
@ -121,7 +124,7 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
|
|||||||
// right border
|
// right border
|
||||||
int right_border = b->size.w - v->size.w - left_border;
|
int right_border = b->size.w - v->size.w - left_border;
|
||||||
if (right_border > 0) {
|
if (right_border > 0) {
|
||||||
if (layout == L_HORIZ) {
|
if (is_only_child && layout == L_HORIZ) {
|
||||||
color = colors->indicator;
|
color = colors->indicator;
|
||||||
} else {
|
} else {
|
||||||
color = colors->child_border;
|
color = colors->child_border;
|
||||||
@ -147,7 +150,7 @@ static void render_borders(swayc_t *view, cairo_t *cr, struct border_colors *col
|
|||||||
// bottom border
|
// bottom border
|
||||||
int bottom_border = b->size.h - (top_border + v->size.h);
|
int bottom_border = b->size.h - (top_border + v->size.h);
|
||||||
if (bottom_border > 0) {
|
if (bottom_border > 0) {
|
||||||
if (layout == L_VERT) {
|
if (is_only_child && layout == L_VERT) {
|
||||||
color = colors->indicator;
|
color = colors->indicator;
|
||||||
} else {
|
} else {
|
||||||
color = colors->child_border;
|
color = colors->child_border;
|
||||||
|
Loading…
Reference in New Issue
Block a user