all repos — tint2 @ 0c36e79996885dc4fb10649f59d257341475b5d6

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

Add behavior to hide an empty taskbar in multi_desktop mode: tint2conf
o9000 mrovi9000@gmail.com
commit

0c36e79996885dc4fb10649f59d257341475b5d6

parent

d0e845022543c9326cb9f20879cb7c09bf72f11b

3 files changed, 19 insertions(+), 0 deletions(-)

jump to
M src/tint2conf/properties.csrc/tint2conf/properties.c

@@ -59,6 +59,7 @@ GtkWidget *taskbar_name_font, *taskbar_name_font_set;

GtkWidget *taskbar_active_background, *taskbar_inactive_background; GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; +GtkWidget *taskbar_hide_empty; // task GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;

@@ -3059,6 +3060,19 @@ gtk_widget_show(taskbar_show_desktop);

gtk_table_attach(GTK_TABLE(table), taskbar_show_desktop, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); col++; gtk_tooltips_set_tip(tooltips, taskbar_show_desktop, _("If enabled, the taskbar is split into multiple smaller taskbars, one for each virtual desktop."), NULL); + + col = 2; + row++; + label = gtk_label_new(_("Hide taskbars for empty desktops")); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0); + gtk_widget_show(label); + gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; + + taskbar_hide_empty = gtk_check_button_new(); + gtk_widget_show(taskbar_hide_empty); + gtk_table_attach(GTK_TABLE(table), taskbar_hide_empty, col, col+1, row, row+1, GTK_FILL, 0, 0, 0); + col++; col = 2; row++;
M src/tint2conf/properties.hsrc/tint2conf/properties.h

@@ -57,6 +57,7 @@ extern GtkWidget *taskbar_name_font, *taskbar_name_font_set;

extern GtkWidget *taskbar_active_background, *taskbar_inactive_background; extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background; extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks; +extern GtkWidget *taskbar_hide_empty; // task extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
M src/tint2conf/properties_rw.csrc/tint2conf/properties_rw.c

@@ -295,6 +295,7 @@ "taskbar_mode = %s\n",

gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop)) ? "multi_desktop" : "single_desktop"); + fprintf(fp, "taskbar_hide_if_empty = %d\n", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(taskbar_hide_empty)) ? 1 : 0); fprintf(fp, "taskbar_padding = %d %d %d\n", (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(taskbar_padding_x)),

@@ -1283,6 +1284,9 @@ if (strcmp(value, "multi_desktop") == 0)

gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 1); else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 0); + } + else if (strcmp(key, "taskbar_hide_if_empty") == 0) { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_hide_empty), atoi(value)); } else if (strcmp(key, "taskbar_distribute_size") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_distribute_size), atoi(value));