summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-26 19:18:35 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-26 19:19:30 (EDT)
commit8a0c2f1baeb46a0d7e6dec536ef28e4bbf270a7d (patch)
treecddf458290d19bffafcc632dd552a3c6d9d46517
parent4020dbcc54379ec163d9a2b6304f54ef220419c2 (diff)
downloadmarquee-8a0c2f1baeb46a0d7e6dec536ef28e4bbf270a7d.zip
marquee-8a0c2f1baeb46a0d7e6dec536ef28e4bbf270a7d.tar.gz
marquee-8a0c2f1baeb46a0d7e6dec536ef28e4bbf270a7d.tar.bz2
MqTabBody: Add "Inspect Element" menu item to every context
-rw-r--r--src/tab-body.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tab-body.c b/src/tab-body.c
index b2276f8..192ce73 100644
--- a/src/tab-body.c
+++ b/src/tab-body.c
@@ -169,6 +169,7 @@ context_menu_cb(WebKitWebView __attribute__((unused)) *web_view,
WebKitContextMenuAction stock_action;
WebKitHitTestResultContext context;
gboolean context_handled;
+ WebKitContextMenuItem *menu_item;
/* Get more hints about the context, since WebKit doesn't describe
* context very well in hit test results. Also, preserve menu items
@@ -293,14 +294,18 @@ context_menu_cb(WebKitWebView __attribute__((unused)) *web_view,
context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
if (is_selection) {
g_print(" selection");
+ context_handled = TRUE;
} else {
context_menu_document_cb(context_menu, nav_items, body);
+ context_handled = TRUE;
}
}
g_print("\n");
if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT) {
- /* ---
- * Inspect Element (stock) */
+ if (context_handled) {
+ NEW_SEPARATOR_ITEM();
+ }
+ NEW_STOCK_ITEM(INSPECT_ELEMENT); /* Inspect Element */
}
return FALSE;