diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2017-04-30 13:28:38 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2017-04-30 13:30:31 -0500 |
commit | e4254819cd147c6c74152a9182543c9c086aae5b (patch) | |
tree | dda246a46527a7b1e294e773fdf173e54a471746 | |
parent | 622b52c292e16f5b9c0bfec5a600b4eeb02b38a3 (diff) | |
download | epiphany-wip/popover-menu-removal.tar.gz |
notebook: Do not use a popover for the tab selection menuwip/popover-menu-removal
GTK+ popover menus are not scrollable, so they are not suitable for a
menu that needs to accomodate huge numbers of items. Currently it is
quite easy to wind up with the menu flowing off the bottom of the
screen, with the menu items becoming inaccessible.
-rw-r--r-- | src/ephy-notebook.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 7f514f05d..0e6eb858b 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -465,7 +465,6 @@ ephy_notebook_constructed (GObject *object) EphyNotebook *notebook = EPHY_NOTEBOOK (object); GtkWidget *hbox; GtkWidget *button; - GtkWidget *popover; G_OBJECT_CLASS (ephy_notebook_parent_class)->constructed (object); @@ -489,9 +488,9 @@ ephy_notebook_constructed (GObject *object) gtk_widget_show (button); notebook->tab_menu = g_menu_new (); - popover = gtk_popover_new (button); - gtk_popover_bind_model (GTK_POPOVER (popover), G_MENU_MODEL (notebook->tab_menu), "win"); - gtk_menu_button_set_popover (GTK_MENU_BUTTON (button), popover); + /* 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)); } static void @@ -574,7 +573,7 @@ ephy_notebook_rebuild_tab_menu (EphyNotebook *notebook) text = get_nth_tab_label_text (GTK_NOTEBOOK (notebook), i); ellipsized_text = ellipsize_tab_label (text); item = g_menu_item_new (ellipsized_text, NULL); - g_menu_item_set_action_and_target (item, "show-tab", "u", (guint)i, NULL); + g_menu_item_set_action_and_target (item, "win.show-tab", "u", (guint)i, NULL); g_menu_append_item (notebook->tab_menu, item); g_free (ellipsized_text); g_object_unref (item); |