Implement desktop view toggles, part of #547

This commit is contained in:
Jeremy Soller 2024-10-04 16:28:30 -06:00
parent cc2a62a14c
commit c511242dd4
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
8 changed files with 459 additions and 125 deletions

View file

@ -95,7 +95,10 @@ pub fn context_menu<'a>(
match (&tab.mode, &tab.location) {
(
tab::Mode::App | tab::Mode::Desktop,
Location::Path(_) | Location::Search(_, _) | Location::Recents,
Location::Desktop(_, _)
| Location::Path(_)
| Location::Search(_, _)
| Location::Recents,
) => {
if selected > 0 {
if selected_dir == 1 && selected == 1 || selected_dir == 0 {
@ -189,11 +192,18 @@ pub fn context_menu<'a>(
children.push(sort_item(fl!("sort-by-name"), HeadingOptions::Name));
children.push(sort_item(fl!("sort-by-modified"), HeadingOptions::Modified));
children.push(sort_item(fl!("sort-by-size"), HeadingOptions::Size));
children.push(divider::horizontal::light().into());
children.push(
menu_item(fl!("desktop-view-options"), Action::DesktopViewOptions).into(),
);
}
}
(
tab::Mode::Dialog(dialog_kind),
Location::Path(_) | Location::Search(_, _) | Location::Recents,
Location::Desktop(_, _)
| Location::Path(_)
| Location::Search(_, _)
| Location::Recents,
) => {
if selected > 0 {
if selected_dir == 1 && selected == 1 || selected_dir == 0 {