From 2a1d8c61569cb744d97d0cbf968d5f7c3e67ffb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sat, 23 Jul 2022 19:30:40 +0200 Subject: properties-window: Add button to Parent Folder row Make it open the parent folder and select the file. Also use a layout which allows to show more of the path. This has been accepted by the design team as the best solution we have at the moment, but it's not a new row design pattern (yet?). --- src/nautilus-properties-window.c | 16 ++++++++++ src/resources/ui/nautilus-properties-window.ui | 43 ++++++++++++++++++++------ 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 0be4d16c2..723ab2202 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -2400,6 +2400,21 @@ setup_volume_usage_widget (NautilusPropertiesWindow *self) } } +static void +open_parent_folder (NautilusPropertiesWindow *self) +{ + g_autoptr (GFile) parent_location = NULL; + + parent_location = nautilus_file_get_parent_location (get_target_file (self)); + g_return_if_fail (parent_location != NULL); + + nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()), + parent_location, + NAUTILUS_OPEN_FLAG_NEW_WINDOW, + &(GList){get_original_file (self), NULL}, + NULL, NULL); +} + static void open_in_disks (NautilusPropertiesWindow *self) { @@ -4638,6 +4653,7 @@ nautilus_properties_window_class_init (NautilusPropertiesWindowClass *klass) gtk_widget_class_bind_template_child (widget_class, NautilusPropertiesWindow, set_as_default_button); gtk_widget_class_bind_template_callback (widget_class, open_in_disks); + gtk_widget_class_bind_template_callback (widget_class, open_parent_folder); gtk_widget_class_bind_template_callback (widget_class, navigate_main_page); gtk_widget_class_bind_template_callback (widget_class, navigate_permissions_page); gtk_widget_class_bind_template_callback (widget_class, navigate_open_with_page); diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui index 05ba9dc6c..b27a32f57 100644 --- a/src/resources/ui/nautilus-properties-window.ui +++ b/src/resources/ui/nautilus-properties-window.ui @@ -347,16 +347,41 @@ False False False - Parent Folder - - - True - True - end - 24 - 1 + + + vertical + 3 + start + center + + + Parent Folder + True + end + start + + + + + + True + True + start + start + + + + + + + folder-open-symbolic + center + -- cgit v1.2.1