summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-22 01:53:40 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-22 01:54:48 (EDT)
commita25251d553f0f20bb1dda949d7bd87e50da18b84 (patch)
tree0e61a0d32edb66410bae52be6686407b34b88c8f /src
parent1322d264cc0949fe99abf30e94807940926320b3 (diff)
downloadmarquee-a25251d553f0f20bb1dda949d7bd87e50da18b84.zip
marquee-a25251d553f0f20bb1dda949d7bd87e50da18b84.tar.gz
marquee-a25251d553f0f20bb1dda949d7bd87e50da18b84.tar.bz2
MqTab: Move tab context menu rows box population code
Also sneak in a comment about the g_signal_connect() call.
Diffstat (limited to 'src')
-rw-r--r--src/tab.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tab.c b/src/tab.c
index 978d0d5..b580b41 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -67,9 +67,9 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
{
GtkWidget *button_grid;
GtkWidget *buttons[BUTTON_ROWS * BUTTON_COLS];
- GtkWidget *box;
GtkWidget *tab_list;
GtkWidget *tab_list_scrolled_window;
+ GtkWidget *box;
GtkWidget *popover; /* TODO: Add to MqWindow */
/* Make sure this is a right mouse button press event. */
@@ -90,11 +90,6 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
NEW_BUTTON(1, 1, "edit-undo", "Undo close tab");
NEW_TOGGLE(1, 3, "view-list-symbolic", "Tab list...");
- /* Set up the button rows box. */
- box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_pack_start(GTK_BOX(box), button_grid,
- TRUE, FALSE, 0);
-
/* Set up the tab list. */
tab_list = gtk_label_new("Tab list");
@@ -111,13 +106,19 @@ tab_label_button_press_cb(GtkWidget *widget, GdkEvent *event, MqTab *tab)
gtk_scrolled_window_set_min_content_height(
GTK_SCROLLED_WINDOW(tab_list_scrolled_window), 200);
gtk_container_add(GTK_CONTAINER(tab_list_scrolled_window), tab_list);
- gtk_box_pack_start(GTK_BOX(box), tab_list_scrolled_window,
- TRUE, FALSE, 0);
+ /* Add tab list toggle button handler. */
g_signal_connect(buttons[1 * BUTTON_COLS + 3], "toggled",
G_CALLBACK(tab_list_button_toggled_cb),
tab_list_scrolled_window);
+ /* Set up the button rows box. */
+ box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_pack_start(GTK_BOX(box), button_grid,
+ TRUE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box), tab_list_scrolled_window,
+ TRUE, FALSE, 0);
+
/* Set up the popover. */
popover = gtk_popover_new(widget);
gtk_container_add(GTK_CONTAINER(popover), box);