all repos — tint2 @ 970c59779648f24663858e4b22f3841e35519097

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

#716 fix executor spacing
Chris Lee @klee93
commit

970c59779648f24663858e4b22f3841e35519097

parent

a82b9a1d7f4ad835183ca17ec38273556cc4b1ff

2 files changed, 32 insertions(+), 10 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,3 +1,6 @@

+2018-09-14 master +- Fix spacing around icons in executor without text in vertical panels (issue #716) + 2018-08-05 16.6.1 - Fix packaging regression for debian (issue #715)
M src/execplugin/execplugin.csrc/execplugin/execplugin.c

@@ -373,7 +373,11 @@ if (!*text_next_line) {

*new_size = *txt_height + 2 * *vert_padding + top_bottom_border_width(area); *new_size = MAX(*new_size, *icon_h + 2 * *vert_padding + top_bottom_border_width(area)); } else { - *new_size = *icon_h + *interior_padding + *txt_height + 2 * *vert_padding + top_bottom_border_width(area); + if (strlen(execp->backend->text)) { + *new_size = *icon_h + *interior_padding + *txt_height + 2 * *vert_padding + top_bottom_border_width(area); + } else { + *new_size = *icon_h + 2 * *vert_padding + top_bottom_border_width(area); + } } if (*new_size != area->height) { *resized = TRUE;

@@ -441,10 +445,17 @@ execp->frontend->iconx = (execp->area.width - txt_width - interior_padding - icon_w) / 2;

execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = execp->frontend->iconx + icon_w + interior_padding; } else { - execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; - execp->frontend->iconx = (execp->area.width - icon_w) / 2; - execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; - execp->frontend->textx = (execp->area.width - txt_width) / 2; + if (strlen(execp->backend->text)) { + execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; + execp->frontend->iconx = (execp->area.width - icon_w) / 2; + execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; + execp->frontend->textx = (execp->area.width - txt_width) / 2; + } else { + execp->frontend->icony = (execp->area.height - icon_h) / 2; + execp->frontend->iconx = (execp->area.width - icon_w) / 2; + execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; + execp->frontend->textx = (execp->area.width - txt_width) / 2; + } } } else { execp->frontend->texty = (execp->area.height - txt_height) / 2;

@@ -458,10 +469,17 @@ execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding;

execp->frontend->texty = (execp->area.height - txt_height) / 2; execp->frontend->textx = execp->frontend->iconx + icon_w + interior_padding; } else { - execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; - execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding; - execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; - execp->frontend->textx = execp->frontend->iconx; + if (strlen(execp->backend->text)) { + execp->frontend->icony = (execp->area.height - icon_h - interior_padding - txt_height) / 2; + execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding; + execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; + execp->frontend->textx = execp->frontend->iconx; + } else { + execp->frontend->icony = (execp->area.height - icon_h) / 2; + execp->frontend->iconx = left_border_width(&execp->area) + horiz_padding; + execp->frontend->texty = execp->frontend->icony + icon_h + interior_padding; + execp->frontend->textx = execp->frontend->iconx; + } } } else { execp->frontend->texty = (execp->area.height - txt_height) / 2;

@@ -531,12 +549,13 @@ if (tmp)

imlib_context_set_image(tmp); } fprintf(stderr, - "tint2: %*sText: x = %d, y = %d, w = %d, align = %s, text = %s\n", + "tint2: %*sText: x = %d, y = %d, w = %d, h = %d, align = %s, text = %s\n", indent, "", execp->frontend->textx, execp->frontend->texty, execp->frontend->textw, + execp->frontend->texth, execp->backend->centered ? "center" : "left", execp->backend->text); }