summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-01 05:37:12 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-01 05:37:12 (EDT)
commit06f7d046509945a917ee8f5ca9fd9c57c8e88e3c (patch)
tree160493aadc25500fc02520f4e9c4407e54ae49ef
parentf0d15bf49fff436cd4e5416fb37b9a5bfe98f8b8 (diff)
downloadmarquee-06f7d046509945a917ee8f5ca9fd9c57c8e88e3c.zip
marquee-06f7d046509945a917ee8f5ca9fd9c57c8e88e3c.tar.gz
marquee-06f7d046509945a917ee8f5ca9fd9c57c8e88e3c.tar.bz2
MqTabChrome: Close menu on about button click
-rw-r--r--src/tab-chrome.c8
-rw-r--r--src/tab-chrome.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 42e2a0c..abaf5a2 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -340,6 +340,7 @@ static void
about_clicked_cb(GtkButton __attribute__((unused)) *button, MqTabChrome *chrome)
{
mq_tab_new("about:", chrome->tab);
+ gtk_widget_hide(chrome->menu_popover);
}
static void
@@ -372,7 +373,6 @@ menu_button_clicked_cb(GtkToolButton *tool_button,
{
GtkWidget *grid;
GtkWidget *buttons[BUTTON_ROWS * BUTTON_COLS];
- GtkWidget *popover;
/* Set up the grid. */
grid = gtk_grid_new();
@@ -402,11 +402,11 @@ menu_button_clicked_cb(GtkToolButton *tool_button,
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);
+ chrome->menu_popover = gtk_popover_new(GTK_WIDGET(tool_button));
+ gtk_container_add(GTK_CONTAINER(chrome->menu_popover), grid);
/* NB: gtk_popover_popup() is new in GTK+ 3.22. */
- gtk_widget_show_all(popover);
+ gtk_widget_show_all(chrome->menu_popover);
}
#undef BUTTON_ROWS
diff --git a/src/tab-chrome.h b/src/tab-chrome.h
index 0fa8640..ff9c552 100644
--- a/src/tab-chrome.h
+++ b/src/tab-chrome.h
@@ -46,6 +46,7 @@ struct MqTabChrome {
GtkWidget *back_forward_popover;
gint back_items;
GtkToolItem *menu_button;
+ GtkWidget *menu_popover;
};
MqTabChrome *