all repos — tint2 @ 7c54f2acf710de2dae3ccb0c17b9fb79d684f2bf

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

Option to shrink panel: add missing code for separator
o9000 mrovi9000@gmail.com
commit

7c54f2acf710de2dae3ccb0c17b9fb79d684f2bf

parent

278a915ba4cba7c87217f0b1520fd4454b564d89

1 files changed, 15 insertions(+), 0 deletions(-)

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

@@ -15,6 +15,8 @@ #include "panel.h"

#include "common.h" #include "separator.h" +int separator_compute_desired_size(void *obj); + Separator *create_separator() { Separator *separator = (Separator *)calloc(1, sizeof(Separator));

@@ -83,6 +85,7 @@ separator->area.size_mode = LAYOUT_FIXED;

separator->area.resize_needed = 1; separator->area.on_screen = TRUE; separator->area._resize = resize_separator; + separator->area._compute_desired_size = separator_compute_desired_size; separator->area._draw_foreground = draw_separator; instantiate_area_gradients(&separator->area); }

@@ -99,6 +102,18 @@

// Cleanup backends g_list_free_full(panel_config.separator_list, destroy_separator); panel_config.separator_list = NULL; +} + +int separator_compute_desired_size(void *obj) +{ + Separator *separator = (Separator *)obj; + if (!separator->area.on_screen) + return 0; + + if (panel_horizontal) + return separator->thickness + 2 * separator->area.paddingxlr + left_right_border_width(&separator->area); + else + return separator->thickness + 2 * separator->area.paddingxlr + top_bottom_border_width(&separator->area); } gboolean resize_separator(void *obj)