all repos — tint2 @ 4df8f475ce2ed8747c2696c8146f9a04582990f9

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

Fix resizing of text elements (issue #661)
o9000 mrovi9000@gmail.com
commit

4df8f475ce2ed8747c2696c8146f9a04582990f9

parent

638264d874c44c6cee5c1045ad32a36656a55407

2 files changed, 12 insertions(+), 7 deletions(-)

jump to
M src/execplugin/execplugin.csrc/execplugin/execplugin.c

@@ -363,10 +363,12 @@ *new_size = *txt_width;

if (*icon_w) *new_size += *interior_padding + *icon_w; *new_size += 2 * *horiz_padding + left_right_border_width(area); - if (*new_size > area->width || *new_size < (area->width - 6)) { - // we try to limit the number of resize - *new_size += 1; + if (*new_size < area->width && abs(*new_size - area->width) < 6) { + // we try to limit the number of resizes + *new_size = area->width; *resized = TRUE; + } else { + *resized = *new_size != area->width; } } else { if (!*text_next_line) {
M src/util/area.csrc/util/area.c

@@ -996,9 +996,13 @@ line2,

line1_font_desc, line2_font_desc); if (panel_horizontal) { - if (new_size > area->width || new_size < (area->width - 6)) { - // we try to limit the number of resizes - area->width = new_size + 1; + if (new_size != area->width) { + if (new_size < area->width && abs(new_size - area->width) < 6) { + // we try to limit the number of resizes + new_size = area->width; + } else { + area->width = new_size; + } *line1_posy = (area->height - line1_height) / 2; if (line2) { *line1_posy -= (line2_height) / 2;

@@ -1008,7 +1012,6 @@ result = TRUE;

} } else { if (new_size != area->height) { - // we try to limit the number of resizes area->height = new_size; *line1_posy = (area->height - line1_height) / 2; if (line2) {