From 89c25dd149c00aeb8bdad103878d34427fd016fa Mon Sep 17 00:00:00 2001 From: russ morris Date: Tue, 10 Jul 2018 17:59:00 -0700 Subject: [PATCH 1/4] fix tabbed titlebar widths --- sway/desktop/render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index f554b813..c4646a26 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -599,7 +599,8 @@ static void render_container_tabbed(struct sway_output *output, struct border_colors *current_colors = &config->border_colors.unfocused; struct sway_container_state *pstate = &con->current; - int tab_width = pstate->swayc_width / pstate->children->length; + double width_gap_adjustment = 2 * pstate->current_gaps; + int tab_width = (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; // Render tabs for (int i = 0; i < pstate->children->length; ++i) { @@ -628,7 +629,7 @@ static void render_container_tabbed(struct sway_output *output, // Make last tab use the remaining width of the parent if (i == pstate->children->length - 1) { - tab_width = pstate->swayc_width - tab_width * i; + tab_width = (pstate->swayc_width - width_gap_adjustment) - tab_width * i; } render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width, From b9d8ecc548e7ed6467660aa4a4cd658c702955b9 Mon Sep 17 00:00:00 2001 From: russ morris Date: Tue, 10 Jul 2018 20:24:57 -0700 Subject: [PATCH 2/4] tabs instead of spaces --- sway/desktop/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index c4646a26..9ebbe9f3 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -599,7 +599,7 @@ static void render_container_tabbed(struct sway_output *output, struct border_colors *current_colors = &config->border_colors.unfocused; struct sway_container_state *pstate = &con->current; - double width_gap_adjustment = 2 * pstate->current_gaps; + double width_gap_adjustment = 2 * pstate->current_gaps; int tab_width = (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; // Render tabs From c06266e12d2eb14e54da665b966dd1f7618dd123 Mon Sep 17 00:00:00 2001 From: russ morris Date: Tue, 10 Jul 2018 20:34:51 -0700 Subject: [PATCH 3/4] fix line lengths --- sway/desktop/render.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 9ebbe9f3..5aec49b5 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -600,7 +600,8 @@ static void render_container_tabbed(struct sway_output *output, struct sway_container_state *pstate = &con->current; double width_gap_adjustment = 2 * pstate->current_gaps; - int tab_width = (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; + int tab_width = + (pstate->swayc_width - width_gap_adjustment) / pstate->children->length; // Render tabs for (int i = 0; i < pstate->children->length; ++i) { @@ -629,7 +630,8 @@ static void render_container_tabbed(struct sway_output *output, // Make last tab use the remaining width of the parent if (i == pstate->children->length - 1) { - tab_width = (pstate->swayc_width - width_gap_adjustment) - tab_width * i; + tab_width = + (pstate->swayc_width - width_gap_adjustment) - tab_width * i; } render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width, From 6ae1004cd16096fec1e94e26eb42b5251ab46ebb Mon Sep 17 00:00:00 2001 From: russ morris Date: Tue, 10 Jul 2018 20:57:05 -0700 Subject: [PATCH 4/4] removed unnecessary parens --- sway/desktop/render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 5aec49b5..28c81942 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -631,7 +631,7 @@ static void render_container_tabbed(struct sway_output *output, // Make last tab use the remaining width of the parent if (i == pstate->children->length - 1) { tab_width = - (pstate->swayc_width - width_gap_adjustment) - tab_width * i; + pstate->swayc_width - width_gap_adjustment - tab_width * i; } render_titlebar(output, damage, child, x, cstate->swayc_y, tab_width,