summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-17 19:01:07 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-17 19:06:41 (EDT)
commite1058f4d43e81c0d4364d54f1ae033682e2f1baa (patch)
treef93146e61b09b807a74c7e086a4956b217c0c3fc /src
parent644b0f4ef3828ff3d0c8ee2db4a5509cee2cdcf1 (diff)
downloadmarquee-e1058f4d43e81c0d4364d54f1ae033682e2f1baa.zip
marquee-e1058f4d43e81c0d4364d54f1ae033682e2f1baa.tar.gz
marquee-e1058f4d43e81c0d4364d54f1ae033682e2f1baa.tar.bz2
src/tab-chrome.c: Monitor middle/right clicks on back/forward
Stub handler for now.
Diffstat (limited to 'src')
-rw-r--r--src/tab-chrome.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 6f27cf7..fba1741 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -40,6 +40,24 @@ forward_clicked_cb(GtkButton __attribute__((unused)) *toolbutton,
webkit_web_view_go_forward(chrome->web_view);
}
+static gboolean
+back_forward_box_button_press_cb(GtkWidget *widget, GdkEvent *event,
+ MqTabChrome *chrome)
+{
+ GtkWidget *popover;
+
+ if (event->type != GDK_BUTTON_PRESS) {
+ return FALSE;
+ }
+
+ popover = gtk_popover_new(widget);
+ gtk_container_add(GTK_CONTAINER(popover), gtk_label_new("History"));
+ /* NB: gtk_popover_popup() is new in GTK+ 3.22. */
+ gtk_widget_show_all(popover);
+
+ return FALSE;
+}
+
static void
stop_reload_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton,
MqTabChrome *chrome)
@@ -63,6 +81,7 @@ navigation_toolbar_new(MqTabChrome *chrome, gchar *uri)
{
GtkToolbar *navigation_toolbar;
GtkToolItem *back_forward_tool_item;
+ GtkWidget *back_forward_event_box;
GtkToolItem *uri_tool_item;
navigation_toolbar = GTK_TOOLBAR(gtk_toolbar_new());
@@ -92,8 +111,13 @@ navigation_toolbar_new(MqTabChrome *chrome, gchar *uri)
gtk_style_context_add_class(
gtk_widget_get_style_context(chrome->back_forward_box), "linked");
- gtk_container_add(GTK_CONTAINER(back_forward_tool_item),
+ back_forward_event_box = gtk_event_box_new();
+ g_signal_connect(back_forward_event_box, "button-press-event",
+ G_CALLBACK(back_forward_box_button_press_cb), chrome);
+ gtk_container_add(GTK_CONTAINER(back_forward_event_box),
chrome->back_forward_box);
+ gtk_container_add(GTK_CONTAINER(back_forward_tool_item),
+ back_forward_event_box);
gtk_toolbar_insert(navigation_toolbar, back_forward_tool_item, -1);
/* Stop/reload button */