[epiphany] application mode: allow tabs



commit 1b8facf14d83991e6206d5629a166b8feb5c4469
Author: Gustavo Noronha Silva <gns gnome org>
Date:   Sat Oct 7 11:48:08 2017 -0300

    application mode: allow tabs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788845

 src/ephy-notebook.c |    5 +----
 src/ephy-window.c   |    9 ++++-----
 2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 1510830..bddbaef 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -338,12 +338,10 @@ static void
 update_tabs_visibility (EphyNotebook *nb,
                         gboolean      before_inserting)
 {
-  EphyEmbedShellMode mode;
   gboolean show_tabs = FALSE;
   guint num;
   EphyPrefsUITabsBarVisibilityPolicy policy;
 
-  mode = ephy_embed_shell_get_mode (EPHY_EMBED_SHELL (ephy_shell_get_default ()));
   num = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb));
 
   if (before_inserting)
@@ -352,8 +350,7 @@ update_tabs_visibility (EphyNotebook *nb,
   policy = g_settings_get_enum (EPHY_SETTINGS_UI,
                                 EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY);
 
-  if (mode != EPHY_EMBED_SHELL_MODE_APPLICATION &&
-      ((policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE && num > 1) ||
+  if (((policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_MORE_THAN_ONE && num > 1) ||
        policy == EPHY_PREFS_UI_TABS_BAR_VISIBILITY_POLICY_ALWAYS))
     show_tabs = TRUE;
 
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 2073622..5ec35ae 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1509,10 +1509,10 @@ populate_context_menu (WebKitWebView       *web_view,
     update_edit_actions_sensitivity (window, TRUE);
     update_link_actions_sensitivity (window, link_has_web_scheme);
 
+    add_action_to_context_menu (context_menu, popup_action_group,
+                                "open-link-in-new-tab", window);
     if (!app_mode) {
       add_action_to_context_menu (context_menu, popup_action_group,
-                                  "open-link-in-new-tab", window);
-      add_action_to_context_menu (context_menu, popup_action_group,
                                   "open-link-in-new-window", window);
       if (!incognito_mode)
         add_action_to_context_menu (context_menu, popup_action_group,
@@ -1845,7 +1845,7 @@ create_web_view_cb (WebKitWebView          *web_view,
   EphyNewTabFlags flags;
   EphyWindow *target_window;
 
-  if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION) &&
+  if ((ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION) ||
       (g_settings_get_boolean (EPHY_SETTINGS_MAIN,
                                EPHY_PREFS_NEW_WINDOWS_IN_TABS) ||
        g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN,
@@ -3022,7 +3022,6 @@ static const char *disabled_actions_for_app_mode[] = { "open",
                                                        "save-as-application",
                                                        "encoding",
                                                        "bookmark-page",
-                                                       "new-tab",
                                                        "home" };
 
 static void
@@ -3200,7 +3199,7 @@ ephy_window_constructed (GObject *object)
       ephy_action_change_sensitivity_flags (G_SIMPLE_ACTION (action),
                                             SENS_FLAG_CHROME, TRUE);
     }
-    chrome &= ~(EPHY_WINDOW_CHROME_LOCATION | EPHY_WINDOW_CHROME_MENU | EPHY_WINDOW_CHROME_TABSBAR | 
EPHY_WINDOW_CHROME_BOOKMARKS);
+    chrome &= ~(EPHY_WINDOW_CHROME_LOCATION | EPHY_WINDOW_CHROME_MENU | EPHY_WINDOW_CHROME_BOOKMARKS);
   } else if (mode == EPHY_EMBED_SHELL_MODE_INCOGNITO) {
     action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
     action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "bookmark-page");


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