all repos — tint2 @ 6ce441ecf1b2916b7b1754bf08d68efebd60d211

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Compute task icon size correctly
o9000 mrovi9000@gmail.com
commit

6ce441ecf1b2916b7b1754bf08d68efebd60d211

parent

995a257b2c1716d99fd2ca5979282388f49ab606

2 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/taskbar/task.csrc/taskbar/task.c

@@ -383,6 +383,13 @@ }

imlib_context_set_image(image); render_image(task->area.pix, pos_x, panel->g_task.icon_posy); + if (0) { + fprintf(stderr, "Task icon size: %d %d pos %d\n", imlib_image_get_width(), imlib_image_get_height(), pos_x); + fprintf(stderr, "Task max size : %d %d\n", panel->g_task.maximum_width, panel->g_task.maximum_height); + fprintf(stderr, "Task area size: %d %d\n", task->area.width, task->area.height); + fprintf(stderr, "Task area bord: %d\n", task->area.bg->border.width); + fprintf(stderr, "\n"); + } } void draw_task(void *obj, cairo_t *c)
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -263,7 +263,8 @@

panel->g_task.text_posx = panel->g_task.background[0]->border.width + panel->g_task.area.paddingxlr; panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); if (panel->g_task.has_icon) { - panel->g_task.icon_size1 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); + panel->g_task.icon_size1 = MIN(panel->g_task.maximum_width, MIN(panel->g_task.maximum_height, panel->g_task.area.height)) - + (2 * panel->g_task.area.paddingy) - 2 * panel->g_task.area.bg->border.width; panel->g_task.text_posx += panel->g_task.icon_size1 + panel->g_task.area.paddingx; panel->g_task.icon_posy = (panel->g_task.area.height - panel->g_task.icon_size1) / 2; }