diff options
-rw-r--r-- | src/tab-chrome.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c index ec4bb77..97dd210 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -301,6 +301,15 @@ uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome) gtk_entry_get_text(GTK_ENTRY(entry))); } +static void +quit_clicked_cb(GtkButton __attribute__((unused)) *button, + MqTabChrome __attribute__((unused)) *chrome) +{ + /* TODO: Make a function mq_application_quit() that shows a confirmation + * dialog. */ + gtk_main_quit(); +} + #define BUTTON_ROWS 6 #define BUTTON_COLS 3 #define NEW_BUTTON(Y, X, ICON, TOOLTIP) \ @@ -312,6 +321,9 @@ uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome) gtk_grid_attach(GTK_GRID(grid), buttons[Y * BUTTON_COLS + X], \ X, Y, 1, 1); \ } while (0) +#define CLICKED_CB(Y, X, CB) \ + g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", \ + G_CALLBACK(CB), chrome) static void menu_button_clicked_cb(GtkToolButton *tool_button, @@ -342,6 +354,8 @@ menu_button_clicked_cb(GtkToolButton *tool_button, NEW_BUTTON(5, 0, "help-about", "About Marquee"); NEW_BUTTON(5, 2, "application-exit", "Quit"); + CLICKED_CB(5, 2, quit_clicked_cb); + /* Set up the popover. */ popover = gtk_popover_new(GTK_WIDGET(tool_button)); gtk_container_add(GTK_CONTAINER(popover), grid); |