summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-09-03 12:45:51 -0700
committerCorey Berla <corey@berla.me>2022-09-03 12:45:51 -0700
commit7c2297e799a36cb2dc6ef6be0174bc8807dc18ba (patch)
treeb2b7a827e0dd5efb4d3b4daef565e6fb7ae05602
parentc0db5af46dd78ab01d34a1655d6765ef75db8caa (diff)
downloadnautilus-7c2297e799a36cb2dc6ef6be0174bc8807dc18ba.tar.gz
sidebar: Make cloudproviders popover menu nested
libcloudproviders provides a menu_model that we use to build a popover menu. It's possible (and true for nextcloud) that these menus can have sub-menus. If the sub-menus have much longer (or shorter) item names, the entire menu will get stretched out. Use GTK_POPOVER_MENU_NESTED when creating the popover menu, creating a nested menu which does not exhibit this issue. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2405
-rw-r--r--src/gtk/nautilusgtkplacessidebar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gtk/nautilusgtkplacessidebar.c b/src/gtk/nautilusgtkplacessidebar.c
index de6f484be..8fe5bbb50 100644
--- a/src/gtk/nautilusgtkplacessidebar.c
+++ b/src/gtk/nautilusgtkplacessidebar.c
@@ -3233,7 +3233,8 @@ build_popup_menu_using_gmenu (NautilusGtkSidebarRow *row)
if (sidebar->popover)
gtk_widget_unparent (sidebar->popover);
- sidebar->popover = gtk_popover_menu_new_from_model (G_MENU_MODEL (menu));
+ sidebar->popover = gtk_popover_menu_new_from_model_full (G_MENU_MODEL (menu),
+ GTK_POPOVER_MENU_NESTED);
g_object_unref (menu);
gtk_widget_set_parent (sidebar->popover, GTK_WIDGET (sidebar));
gtk_widget_set_halign (sidebar->popover, GTK_ALIGN_START);