diff --git a/i18n/en/cosmic_files.ftl b/i18n/en/cosmic_files.ftl index e7579d1..5714dab 100644 --- a/i18n/en/cosmic_files.ftl +++ b/i18n/en/cosmic_files.ftl @@ -208,7 +208,6 @@ file = File new-tab = New tab new-window = New window rename = Rename... -menu-show-details = Show details... close-tab = Close tab quit = Quit @@ -228,6 +227,7 @@ grid-view = Grid view list-view = List view show-hidden-files = Show hidden files list-directories-first = List directories first +gallery-preview = Gallery preview menu-settings = Settings... menu-about = About COSMIC Files... diff --git a/src/app.rs b/src/app.rs index e47c5fd..84678f8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -95,6 +95,7 @@ pub enum Action { EditHistory, EditLocation, ExtractHere, + Gallery, HistoryNext, HistoryPrevious, ItemDown, @@ -147,6 +148,7 @@ impl Action { Action::EditHistory => Message::ToggleContextPage(ContextPage::EditHistory), Action::EditLocation => Message::EditLocation(entity_opt), Action::ExtractHere => Message::ExtractHere(entity_opt), + Action::Gallery => Message::TabMessage(entity_opt, tab::Message::GalleryToggle), Action::HistoryNext => Message::TabMessage(entity_opt, tab::Message::GoNext), Action::HistoryPrevious => Message::TabMessage(entity_opt, tab::Message::GoPrevious), Action::ItemDown => Message::TabMessage(entity_opt, tab::Message::ItemDown), diff --git a/src/key_bind.rs b/src/key_bind.rs index efb9a75..10b5c8d 100644 --- a/src/key_bind.rs +++ b/src/key_bind.rs @@ -27,6 +27,7 @@ pub fn key_binds() -> HashMap { bind!([Ctrl], Key::Character("c".into()), Copy); bind!([Ctrl], Key::Character("x".into()), Cut); bind!([Ctrl], Key::Character("l".into()), EditLocation); + bind!([], Key::Named(Named::Space), Gallery); bind!([Alt], Key::Named(Named::ArrowRight), HistoryNext); bind!([Alt], Key::Named(Named::ArrowLeft), HistoryPrevious); bind!([], Key::Named(Named::Backspace), HistoryPrevious); @@ -47,7 +48,7 @@ pub fn key_binds() -> HashMap { bind!([Ctrl], Key::Named(Named::Enter), OpenInNewTab); bind!([Shift], Key::Named(Named::Enter), OpenInNewWindow); bind!([Ctrl], Key::Character("v".into()), Paste); - bind!([], Key::Named(Named::Space), Preview); + bind!([Ctrl], Key::Named(Named::Space), Preview); bind!([], Key::Named(Named::F2), Rename); bind!([Ctrl], Key::Character("f".into()), SearchActivate); bind!([Ctrl], Key::Character("a".into()), SelectAll); diff --git a/src/menu.rs b/src/menu.rs index 46c54f8..fb501af 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -412,8 +412,6 @@ pub fn menu_bar<'a>( menu::Item::Divider, menu_button_optional(fl!("rename"), Action::Rename, selected > 0), menu::Item::Divider, - menu_button_optional(fl!("menu-show-details"), Action::Preview, selected > 0), - menu::Item::Divider, menu_button_optional(fl!("add-to-sidebar"), Action::AddToSidebar, selected > 0), menu::Item::Divider, menu_button_optional(fl!("move-to-trash"), Action::MoveToTrash, selected > 0), @@ -467,6 +465,9 @@ pub fn menu_bar<'a>( tab_opt.map_or(false, |tab| tab.config.folders_first), Action::ToggleFoldersFirst, ), + menu_button_optional(fl!("show-details"), Action::Preview, selected > 0), + menu::Item::Divider, + menu_button_optional(fl!("gallery-preview"), Action::Gallery, selected > 0), menu::Item::Divider, menu::Item::Button(fl!("menu-settings"), Action::Settings), menu::Item::Divider, diff --git a/src/tab.rs b/src/tab.rs index fd78a09..ac91e14 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -850,6 +850,7 @@ pub enum Message { Gallery(bool), GalleryPrevious, GalleryNext, + GalleryToggle, GoNext, GoPrevious, ItemDown, @@ -2071,6 +2072,9 @@ impl Tab { commands.push(Command::Iced(widget::button::focus(id))); } } + Message::GalleryToggle => { + self.gallery = !self.gallery; + } Message::GoNext => { if let Some(history_i) = self.history_i.checked_add(1) { if let Some(location) = self.history.get(history_i) {