[epiphany] header-bar: Drop the Flatpak specific menu



commit 5a46ea0b15c9c7397df460f5e1cd689de0aae1a2
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Jun 27 19:16:34 2018 +0200

    header-bar: Drop the Flatpak specific menu
    
    Instead of having two mostly similar menus for when running within and
    without of Flatpak, this manually removes the unwanted elements from the
    menu and drop the Flatpak specific menu, avoiding duplication.

 po/POTFILES.in                                 |   1 -
 src/ephy-header-bar.c                          |  11 +-
 src/resources/epiphany.gresource.xml           |   1 -
 src/resources/gtk/page-menu-popover-flatpak.ui | 172 -------------------------
 4 files changed, 5 insertions(+), 180 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d9a213822..22f5c0cd4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -65,7 +65,6 @@ src/resources/gtk/encoding-dialog.ui
 src/resources/gtk/history-dialog.ui
 src/resources/gtk/menus.ui
 src/resources/gtk/page-menu-popover.ui
-src/resources/gtk/page-menu-popover-flatpak.ui
 src/resources/gtk/passwords-dialog.ui
 src/resources/gtk/prefs-dialog.ui
 src/resources/gtk/prefs-lang-dialog.ui
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index 8a9d2b5bf..b17ef7a50 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -206,14 +206,13 @@ ephy_header_bar_constructed (GObject *object)
                         gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_BUTTON));
   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
   g_type_ensure (G_TYPE_THEMED_ICON);
-  /* FIXME: This is horrible, but it doesn't seem possible to hide a single menu item of an existing menu.
-   * Calling gtk_widget_hide() on the child menu item somehow hides the entire menu! */
-  if (ephy_is_running_inside_flatpak ())
-    builder = gtk_builder_new_from_resource ("/org/gnome/epiphany/gtk/page-menu-popover-flatpak.ui");
-  else
-    builder = gtk_builder_new_from_resource ("/org/gnome/epiphany/gtk/page-menu-popover.ui");
+  builder = gtk_builder_new_from_resource ("/org/gnome/epiphany/gtk/page-menu-popover.ui");
   page_menu_popover = GTK_WIDGET (gtk_builder_get_object (builder, "page-menu-popover"));
   header_bar->zoom_level_button = GTK_WIDGET (gtk_builder_get_object (builder, "zoom-level"));
+  if (ephy_is_running_inside_flatpak ()) {
+    gtk_widget_destroy (GTK_WIDGET (gtk_builder_get_object (builder, "save-as-application-separator")));
+    gtk_widget_destroy (GTK_WIDGET (gtk_builder_get_object (builder, "save-as-application-button")));
+  }
   gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), page_menu_popover);
   g_object_unref (builder);
 
diff --git a/src/resources/epiphany.gresource.xml b/src/resources/epiphany.gresource.xml
index c797d2a53..380de489c 100644
--- a/src/resources/epiphany.gresource.xml
+++ b/src/resources/epiphany.gresource.xml
@@ -26,7 +26,6 @@
     <file preprocess="xml-stripblanks" compressed="true">gtk/history-dialog.ui</file>
     <file preprocess="xml-stripblanks" compressed="true">gtk/menus.ui</file>
     <file preprocess="xml-stripblanks" compressed="true">gtk/page-menu-popover.ui</file>
-    <file preprocess="xml-stripblanks" compressed="true">gtk/page-menu-popover-flatpak.ui</file>
     <file preprocess="xml-stripblanks" compressed="true">gtk/passwords-dialog.ui</file>
     <file preprocess="xml-stripblanks" compressed="true">gtk/prefs-dialog.ui</file>
     <file preprocess="xml-stripblanks" compressed="true">gtk/prefs-lang-dialog.ui</file>


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