aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-05-01 19:21:29 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-05-01 19:21:29 +1000
commita19a511b90d214f200bfca1cffad0376b855caac (patch)
tree9d8934d26cf9e222665716beb14ca7b4ecd8ea10
parentd847ac1120b87bfe0ac5747964a1299cabd3bc19 (diff)
Implement indicator border
-rw-r--r--sway/desktop/output.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 498a3a2e..e0a211d1 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -245,6 +245,11 @@ static void render_container_simple_border_normal(struct sway_output *output,
output->wlr_output->transform_matrix);
// Child border - right edge
+ if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
+ memcpy(&color, colors->indicator, sizeof(float) * 3);
+ } else {
+ memcpy(&color, colors->child_border, sizeof(float) * 3);
+ }
box.x = con->x + con->width - con->sway_view->border_thickness;
box.y = con->y + 1;
box.width = con->sway_view->border_thickness;
@@ -254,6 +259,11 @@ static void render_container_simple_border_normal(struct sway_output *output,
output->wlr_output->transform_matrix);
// Child border - bottom edge
+ if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
+ memcpy(&color, colors->indicator, sizeof(float) * 3);
+ } else {
+ memcpy(&color, colors->child_border, sizeof(float) * 3);
+ }
box.x = con->x;
box.y = con->y + con->height - con->sway_view->border_thickness;
box.width = con->width;
@@ -317,6 +327,11 @@ static void render_container_simple_border_pixel(struct sway_output *output,
output->wlr_output->transform_matrix);
// Child border - right edge
+ if (con->parent->children->length == 1 && con->parent->layout == L_HORIZ) {
+ memcpy(&color, colors->indicator, sizeof(float) * 3);
+ } else {
+ memcpy(&color, colors->child_border, sizeof(float) * 3);
+ }
box.x = con->x + con->width - con->sway_view->border_thickness;
box.y = con->y;
box.width = con->sway_view->border_thickness;
@@ -335,6 +350,11 @@ static void render_container_simple_border_pixel(struct sway_output *output,
output->wlr_output->transform_matrix);
// Child border - bottom edge
+ if (con->parent->children->length == 1 && con->parent->layout == L_VERT) {
+ memcpy(&color, colors->indicator, sizeof(float) * 3);
+ } else {
+ memcpy(&color, colors->child_border, sizeof(float) * 3);
+ }
box.x = con->x;
box.y = con->y + con->height - con->sway_view->border_thickness;
box.width = con->width;