diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/window.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c index f3bfa41..c1eaa4e 100644 --- a/src/window.c +++ b/src/window.c @@ -27,14 +27,13 @@ #include "tab.h" static void -tab_list_button_clicked_cb(GtkButton __attribute__((unused)) *button, - GtkStack *stack) +tab_list_button_toggled_cb(GtkToggleButton *toggle_button, GtkWidget *tab_list) { - /* Use gtk_widget_show() and gtk_widget_hide() instead of - * gtk_stack_set_visible_child() so that the stack fits the size of only - * the visible child. */ - gtk_widget_show(gtk_stack_get_child_by_name(stack, "tab_list")); - gtk_widget_hide(gtk_stack_get_child_by_name(stack, "buttons")); + if (gtk_toggle_button_get_active(toggle_button)) { + gtk_widget_show(tab_list); + } else { + gtk_widget_hide(tab_list); + } } static void @@ -110,10 +109,8 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab) gtk_box_pack_start(GTK_BOX(box), tab_list, TRUE, FALSE, 0); - /* - g_signal_connect(buttons[1 * BUTTON_COLS + 3], "clicked", - G_CALLBACK(tab_list_button_clicked_cb), GTK_STACK(stack)); - */ + g_signal_connect(buttons[1 * BUTTON_COLS + 3], "toggled", + G_CALLBACK(tab_list_button_toggled_cb), tab_list); /* Set up the popover. */ popover = gtk_popover_new(widget); |