summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-19 12:51:58 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-19 12:51:58 (EDT)
commit8b04e752850c429250a1b5b97991678d0065379d (patch)
tree01bf4ccd625277e60093c74dd0343c88c383616e /src
parent1908b4dd96d2525cf639225c8afc3e2e7bb5ecb9 (diff)
downloadmarquee-8b04e752850c429250a1b5b97991678d0065379d.zip
marquee-8b04e752850c429250a1b5b97991678d0065379d.tar.gz
marquee-8b04e752850c429250a1b5b97991678d0065379d.tar.bz2
src/window.c: Make tab list button functional
Diffstat (limited to 'src')
-rw-r--r--src/window.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index e062ed3..0b1b634 100644
--- a/src/window.c
+++ b/src/window.c
@@ -26,6 +26,17 @@
#include "window.h"
#include "tab.h"
+static void
+tab_list_button_clicked_cb(GtkButton __attribute__((unused)) *button,
+ GtkStack *stack)
+{
+ /* 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"));
+}
+
#define NEW_BUTTON(BOX, I, NAME, TOOLTIP) \
do { \
buttons[I] = gtk_button_new_from_icon_name(NAME, \
@@ -80,6 +91,9 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
gtk_stack_add_named(GTK_STACK(stack), gtk_label_new("Tab list"),
"tab_list");
+ g_signal_connect(buttons[6], "clicked",
+ G_CALLBACK(tab_list_button_clicked_cb), GTK_STACK(stack));
+
/* Set up the popover. */
popover = gtk_popover_new(widget);
gtk_container_add(GTK_CONTAINER(popover), stack);