Workaround to support favorited files

This commit is contained in:
Jeremy Soller 2024-05-09 13:55:57 -06:00
parent 76a95820a4
commit 8ba70f2f93
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 14 additions and 2 deletions

View file

@ -148,7 +148,7 @@ impl MenuAction for Action {
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum ContextItem {
pub enum ContextItem {
NavBar(segmented_button::Entity),
TabBar(segmented_button::Entity),
}

View file

@ -1218,7 +1218,19 @@ impl Tab {
}
}
Message::Location(location) => {
cd = Some(location);
// Workaround to support favorited files
match &location {
Location::Path(path) => {
if path.is_dir() {
cd = Some(location);
} else {
commands.push(Command::OpenFile(path.clone()));
}
}
Location::Trash => {
cd = Some(location);
}
}
}
Message::LocationUp => {
// Sets location to the path's parent