[epiphany] notebook: Use a popover for the pages list



commit 912389a3f3bb262a3ebbe85cdadfe4679ecdbc17
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Jan 23 16:11:56 2019 +0100

    notebook: Use a popover for the pages list
    
    This allows the pages manu to look nicer and to more useful as pages can
    now be closed from it.

 src/ephy-notebook.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index c27ac21e8..c51d78678 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -29,6 +29,7 @@
 #include "ephy-embed.h"
 #include "ephy-file-helpers.h"
 #include "ephy-link.h"
+#include "ephy-pages-popover.h"
 #include "ephy-prefs.h"
 #include "ephy-settings.h"
 #include "ephy-shell.h"
@@ -478,6 +479,7 @@ ephy_notebook_constructed (GObject *object)
   EphyNotebook *notebook = EPHY_NOTEBOOK (object);
   GtkWidget *hbox;
   GtkWidget *button;
+  EphyPagesPopover *popover;
 
   G_OBJECT_CLASS (ephy_notebook_parent_class)->constructed (object);
 
@@ -494,8 +496,11 @@ ephy_notebook_constructed (GObject *object)
 
   notebook->tab_menu = g_menu_new ();
   /* Remove this when popover menus become scrollable. */
-  gtk_menu_button_set_use_popover (GTK_MENU_BUTTON (button), FALSE);
-  gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (notebook->tab_menu));
+  gtk_menu_button_set_use_popover (GTK_MENU_BUTTON (button), TRUE);
+
+  popover = ephy_pages_popover_new (GTK_WIDGET (button));
+  ephy_pages_popover_set_notebook (popover, notebook);
+  gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), GTK_WIDGET (popover));
 }
 
 static void


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