[epiphany] Hide elements that shouldn't be used in application mode



commit d053d494841466b27f58158085f11b5ad0011358
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Tue Dec 25 00:01:53 2018 +0100

    Hide elements that shouldn't be used in application mode
    
      - View Image in new tab
      - Open Video in new window
      - Open Video in new tab
      - Open Audio in new window
      - Open Audio in new tab
      - Save as
      - View page source
      - Inspect
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/309

 src/ephy-window.c | 48 ++++++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 20 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 9be41ff81..f8279c0b3 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1644,8 +1644,10 @@ populate_context_menu (WebKitWebView       *web_view,
     add_item_to_context_menu (context_menu, copy_image_item);
     add_action_to_context_menu (context_menu, popup_action_group,
                                 "copy-image-location", window);
-    add_action_to_context_menu (context_menu, popup_action_group,
-                                "view-image", window);
+    if (!app_mode)
+      add_action_to_context_menu (context_menu, popup_action_group,
+                                  "view-image", window);
+
     add_action_to_context_menu (context_menu, popup_action_group,
                                 "set-image-as-background", window);
   }
@@ -1659,19 +1661,23 @@ populate_context_menu (WebKitWebView       *web_view,
     webkit_context_menu_append (context_menu,
                                 webkit_context_menu_item_new_separator ());
     if (is_video) {
-      add_action_to_context_menu (context_menu, popup_action_group,
-                                  "open-video-in-new-window", window);
-      add_action_to_context_menu (context_menu, popup_action_group,
-                                  "open-video-in-new-tab", window);
+      if (!app_mode) {
+        add_action_to_context_menu (context_menu, popup_action_group,
+                                    "open-video-in-new-window", window);
+        add_action_to_context_menu (context_menu, popup_action_group,
+                                    "open-video-in-new-tab", window);
+      }
       add_action_to_context_menu (context_menu, popup_action_group,
                                   "save-video-as", window);
       add_action_to_context_menu (context_menu, popup_action_group,
                                   "copy-video-location", window);
     } else if (is_audio) {
-      add_action_to_context_menu (context_menu, popup_action_group,
-                                  "open-audio-in-new-window", window);
-      add_action_to_context_menu (context_menu, popup_action_group,
-                                  "open-audio-in-new-tab", window);
+      if (!app_mode) {
+        add_action_to_context_menu (context_menu, popup_action_group,
+                                    "open-audio-in-new-window", window);
+        add_action_to_context_menu (context_menu, popup_action_group,
+                                    "open-audio-in-new-tab", window);
+      }
       add_action_to_context_menu (context_menu, popup_action_group,
                                   "save-audios-as", window);
       add_action_to_context_menu (context_menu, popup_action_group,
@@ -1692,17 +1698,19 @@ populate_context_menu (WebKitWebView       *web_view,
                                 "send-to", window);
   }
 
-  webkit_context_menu_append (context_menu,
-                              webkit_context_menu_item_new_separator ());
-  add_action_to_context_menu (context_menu, window_action_group,
-                              "save-as", window);
+  if (!app_mode) {
+    webkit_context_menu_append (context_menu,
+                                webkit_context_menu_item_new_separator ());
+    add_action_to_context_menu (context_menu, window_action_group,
+                                "save-as", window);
 
-  webkit_context_menu_append (context_menu,
-                              webkit_context_menu_item_new_separator ());
-  add_action_to_context_menu (context_menu, window_action_group,
-                              "page-source", window);
-  webkit_context_menu_append (context_menu,
-                              webkit_context_menu_item_new_from_stock_action 
(WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
+    webkit_context_menu_append (context_menu,
+                                webkit_context_menu_item_new_separator ());
+    add_action_to_context_menu (context_menu, window_action_group,
+                                "page-source", window);
+    webkit_context_menu_append (context_menu,
+                                webkit_context_menu_item_new_from_stock_action 
(WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT));
+  }
 
   return FALSE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]