[nautilus/gtk4-preparation-trunk: 28/84] pathbar: Activate menu button when clicking background




commit f4f4cea41bf3237b4c17760398cc9c9292d03bfa
Author: António Fernandes <antoniof gnome org>
Date:   Sat Nov 27 00:59:50 2021 +0000

    pathbar: Activate menu button when clicking background
    
    Including the current folder name.
    
    This should improve discoverability and ease the transition for users
    who were used to click on the current folder name.

 src/nautilus-pathbar.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index d761dcad6..58a680a8a 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -559,6 +559,14 @@ nautilus_path_bar_clear_buttons (NautilusPathBar *self)
     }
 }
 
+static void
+nautilus_path_bar_show_current_location_menu (NautilusPathBar *self)
+{
+    g_return_if_fail (NAUTILUS_IS_PATH_BAR (self));
+
+    g_signal_emit_by_name (self->current_view_menu_button, "activate");
+}
+
 static void
 button_clicked_cb (GtkButton *button,
                    gpointer   data)
@@ -587,7 +595,7 @@ button_clicked_cb (GtkButton *button,
     {
         if (g_file_equal (button_data->path, self->current_path))
         {
-            gtk_popover_popup (self->current_view_menu_popover);
+            nautilus_path_bar_show_current_location_menu (self);
         }
         else
         {
@@ -714,7 +722,7 @@ on_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
         {
             if (g_file_equal (button_data->path, self->current_path))
             {
-                gtk_popover_popup (self->current_view_menu_popover);
+                nautilus_path_bar_show_current_location_menu (self);
             }
             else
             {
@@ -1136,6 +1144,8 @@ make_button_data (NautilusPathBar *self,
     {
         gtk_style_context_add_class (gtk_widget_get_style_context (button_data->button),
                                      "current-dir");
+        gtk_widget_set_hexpand (button_data->button, TRUE);
+        gtk_widget_set_halign (button_data->label, GTK_ALIGN_START);
     }
 
     if (button_data->label != NULL)


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