From f132da90423b2f02848cbd2b9be2030e46489de3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jun 2007 04:11:11 +0000 Subject: [PATCH] more layout fixing. make the grills smaller. don't add arbirary padding on the left side, without taking it into account for the width. use any extra pixels up in the last task (with size limiting) --- dims.h | 2 +- gui.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dims.h b/dims.h index e043b1e..4210cc1 100644 --- a/dims.h +++ b/dims.h @@ -3,6 +3,6 @@ /* don't edit these */ #define TEXTPAD 6 -#define GRILL_WIDTH 10 +#define GRILL_WIDTH 4 #endif diff --git a/gui.c b/gui.c index bb0e513..a1655e6 100644 --- a/gui.c +++ b/gui.c @@ -290,7 +290,7 @@ void gui_draw_taskbar(screen *sc, taskbar *tb) #ifdef PAGER pager_draw(); #else - pager_size = TEXTPAD; + pager_size = GRILL_WIDTH; #endif ow = tb->draww; @@ -302,7 +302,7 @@ void gui_draw_taskbar(screen *sc, taskbar *tb) (tb->at_top ? -sc->theme->obwidth : 0), tb->draww, tb->drawh); - x = pager_size + 2; + x = pager_size; width = tb->draww - (pager_size + GRILL_WIDTH); /* only re-render if the size has changed */ @@ -326,17 +326,19 @@ void gui_draw_taskbar(screen *sc, taskbar *tb) goto clear; taskw = width / num_tasks; - if (taskw > MAX_TASK_WIDTH) - taskw = MAX_TASK_WIDTH; for (tk = tb->task_list; tk; tk = tk->next) { if (!task_shown(tk)) continue; tk->pos_x = x; - tk->width = taskw; + /* use up extra pixels in the last task */ + if (!tk->next) + tk->width = MIN(width - x, MAX_TASK_WIDTH); + else + tk->width = MIN(taskw, MAX_TASK_WIDTH); gui_draw_task(sc, tb, tk, FALSE); set_icon_geometry(sc, tb, tk); - x += taskw; + x += tk->width; } clear: -- 2.39.2