[nautilus/wip/corey/sidebar-cloudproviders-menu] sidebar: Make cloudproviders popover menu nested




commit 7c2297e799a36cb2dc6ef6be0174bc8807dc18ba
Author: Corey Berla <corey berla me>
Date:   Sat Sep 3 12:45:51 2022 -0700

    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

 src/gtk/nautilusgtkplacessidebar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
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);


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