summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2022-07-23 19:30:40 +0200
committerAntónio Fernandes <antoniof@gnome.org>2022-07-28 19:16:34 +0100
commit2a1d8c61569cb744d97d0cbf968d5f7c3e67ffb8 (patch)
tree45c2d6508db7d56de5ed2d8a11d7a734ed6c6c75
parent1411a35a5e0cb54a8859a851246755a03d973bed (diff)
downloadnautilus-2a1d8c61569cb744d97d0cbf968d5f7c3e67ffb8.tar.gz
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?).
-rw-r--r--src/nautilus-properties-window.c16
-rw-r--r--src/resources/ui/nautilus-properties-window.ui43
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
@@ -2401,6 +2401,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)
{
NautilusDBusLauncher *launcher = nautilus_dbus_launcher_get ();
@@ -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 @@
<property name="visible">False</property>
<property name="activatable">False</property>
<property name="selectable">False</property>
- <property name="title" translatable="yes">Parent Folder</property>
- <child>
- <object class="GtkLabel" id="parent_folder_value_label">
- <property name="hexpand">True</property>
- <property name="selectable">True</property>
- <property name="ellipsize">end</property>
- <property name="max-width-chars">24</property>
- <property name="xalign">1</property>
+ <child type="prefix">
+ <object class="GtkBox">
+ <property name="orientation">vertical</property>
+ <property name="spacing">3</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">Parent Folder</property>
+ <property name="hexpand">True</property>
+ <property name="ellipsize">end</property>
+ <property name="halign">start</property>
+ <style>
+ <class name="caption"/>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="parent_folder_value_label">
+ <property name="hexpand">True</property>
+ <property name="selectable">True</property>
+ <property name="ellipsize">start</property>
+ <property name="halign">start</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="suffix">
+ <object class="GtkButton">
+ <property name="icon-name">folder-open-symbolic</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="open_parent_folder" swapped="yes"/>
<style>
- <class name="dim-label"/>
+ <class name="flat"/>
</style>
</object>
</child>