From 0604df39ca01299c7f3b83232f1a762cabd6b30b Mon Sep 17 00:00:00 2001 From: Jason Rodney Hansen Date: Sun, 9 Mar 2025 14:07:02 -0600 Subject: [PATCH] Edit location when clicking on current directory This makes it so clicking on the name of the current directory (the last item) in the breadcrumbs puts it into edit mode. Before, it wouldn't do anything, because you're already in the dir. Now it does something useful. This change matches the behavior of Gnome Files. --- src/tab.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tab.rs b/src/tab.rs index e0aa77e..2378bb7 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -3874,7 +3874,11 @@ impl Tab { widget::button::custom(row) .padding(space_xxxs) .class(theme::Button::Link) - .on_press(Message::Location(location.clone())), + .on_press(if ancestor == path { + Message::EditLocation(Some(self.location.clone().into())) + } else { + Message::Location(location.clone()) + }), ); if self.location_context_menu_index.is_some() {