diff --git a/i18n/en/cosmic_files.ftl b/i18n/en/cosmic_files.ftl index bf5fee4..7a7f587 100644 --- a/i18n/en/cosmic_files.ftl +++ b/i18n/en/cosmic_files.ftl @@ -94,20 +94,20 @@ renamed = Renamed {$from} to {$to} restoring = Restoring {$items} {$items -> [one] item *[other] items - } from {trash} + } from {trash} restored = Restored {$items} {$items -> [one] item *[other] items - } from {trash} + } from {trash} undo = Undo unknown-folder = unknown folder ## Open with -open-with = Open with +open-with = Open with... default-app = {$name} (default) -## Properties -properties = Properties +## Show details +show-details = Show details ## Settings settings = Settings @@ -130,8 +130,8 @@ light = Light # Context menu add-to-sidebar = Add to sidebar -new-file = New file -new-folder = New folder +new-file = New file... +new-folder = New folder... open-in-terminal = Open in terminal move-to-trash = Move to trash restore-from-trash = Restore from trash @@ -146,7 +146,8 @@ sort-by-size = Sort by size file = File new-tab = New tab new-window = New window -rename = Rename +rename = Rename... +menu-show-details = Show details... close-tab = Close tab quit = Quit diff --git a/src/app.rs b/src/app.rs index 39980d8..8763081 100644 --- a/src/app.rs +++ b/src/app.rs @@ -284,7 +284,7 @@ impl ContextPage { Self::About => String::new(), Self::EditHistory => fl!("edit-history"), Self::OpenWith => fl!("open-with"), - Self::Properties(..) => fl!("properties"), + Self::Properties(..) => String::default(), Self::Settings => fl!("settings"), } } @@ -1087,7 +1087,7 @@ impl Application for App { ), cosmic::widget::menu::Item::Divider, cosmic::widget::menu::Item::Button( - fl!("properties"), + fl!("show-details"), NavMenuAction::Properties(id), ), cosmic::widget::menu::Item::Divider, diff --git a/src/key_bind.rs b/src/key_bind.rs index 2070e00..16b7076 100644 --- a/src/key_bind.rs +++ b/src/key_bind.rs @@ -23,6 +23,7 @@ pub fn key_binds() -> HashMap { }}; } + bind!([Ctrl], Key::Character("d".into()), AddToSidebar); bind!([Ctrl], Key::Character("c".into()), Copy); bind!([Ctrl], Key::Character("x".into()), Cut); bind!([Ctrl], Key::Character("l".into()), EditLocation); @@ -49,6 +50,7 @@ pub fn key_binds() -> HashMap { bind!([], Key::Named(Named::F2), Rename); bind!([Ctrl], Key::Character("f".into()), SearchActivate); bind!([Ctrl], Key::Character("a".into()), SelectAll); + bind!([Ctrl], Key::Character(",".into()), Settings); bind!([Ctrl], Key::Character("w".into()), TabClose); bind!([Ctrl], Key::Character("t".into()), TabNew); bind!([Ctrl], Key::Named(Named::Tab), TabNext); diff --git a/src/menu.rs b/src/menu.rs index 5621d84..b0aa3fc 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -5,6 +5,7 @@ use cosmic::{ iced::{widget::horizontal_rule, Alignment, Background, Border, Length}, theme, widget, + widget::container, widget::menu::{self, key_bind::KeyBind, ItemHeight, ItemWidth, MenuBar}, Element, }; @@ -109,17 +110,16 @@ pub fn context_menu<'a>( children .push(menu_item(fl!("open-in-new-window"), Action::OpenInNewWindow).into()); } - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); children.push(menu_item(fl!("rename"), Action::Rename).into()); children.push(menu_item(fl!("cut"), Action::Cut).into()); children.push(menu_item(fl!("copy"), Action::Copy).into()); //TODO: Print? - children.push(horizontal_rule(1).into()); - //TODO: change to Show details - children.push(menu_item(fl!("properties"), Action::Properties).into()); - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); + children.push(menu_item(fl!("show-details"), Action::Properties).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); children.push(menu_item(fl!("add-to-sidebar"), Action::AddToSidebar).into()); - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); children.push(menu_item(fl!("move-to-trash"), Action::MoveToTrash).into()); } else { //TODO: need better designs for menu with no selection @@ -127,10 +127,10 @@ pub fn context_menu<'a>( children.push(menu_item(fl!("new-file"), Action::NewFile).into()); children.push(menu_item(fl!("new-folder"), Action::NewFolder).into()); children.push(menu_item(fl!("open-in-terminal"), Action::OpenTerminal).into()); - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); children.push(menu_item(fl!("select-all"), Action::SelectAll).into()); children.push(menu_item(fl!("paste"), Action::Paste).into()); - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); // TODO: Nested menu children.push(sort_item(fl!("sort-by-name"), HeadingOptions::Name)); children.push(sort_item(fl!("sort-by-modified"), HeadingOptions::Modified)); @@ -140,13 +140,13 @@ pub fn context_menu<'a>( Location::Trash => { children.push(menu_item(fl!("select-all"), Action::SelectAll).into()); if selected > 0 { - children.push(horizontal_rule(1).into()); - children.push(menu_item(fl!("properties"), Action::Properties).into()); - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); + children.push(menu_item(fl!("show-details"), Action::Properties).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); children .push(menu_item(fl!("restore-from-trash"), Action::RestoreFromTrash).into()); } - children.push(horizontal_rule(1).into()); + children.push(container(horizontal_rule(1)).padding([0, 8]).into()); // TODO: Nested menu children.push(sort_item(fl!("sort-by-name"), HeadingOptions::Name)); children.push(sort_item(fl!("sort-by-modified"), HeadingOptions::Modified)); @@ -191,9 +191,13 @@ pub fn menu_bar<'a>( menu::Item::Button(fl!("new-file"), Action::NewFile), menu::Item::Button(fl!("new-folder"), Action::NewFolder), menu::Item::Button(fl!("open"), Action::Open), + menu::Item::Button(fl!("open-with"), Action::OpenWith), menu::Item::Divider, menu::Item::Button(fl!("rename"), Action::Rename), - //TOOD: add to sidebar, then divider + menu::Item::Divider, + menu::Item::Button(fl!("menu-show-details"), Action::Properties), + menu::Item::Divider, + menu::Item::Button(fl!("add-to-sidebar"), Action::AddToSidebar), menu::Item::Divider, menu::Item::Button(fl!("move-to-trash"), Action::MoveToTrash), menu::Item::Divider, @@ -272,8 +276,8 @@ pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Mess LocationMenuAction::OpenInNewWindow(ancestor_index), )) .into(), - horizontal_rule(1).into(), - menu_button!(widget::text(fl!("properties"))) + container(horizontal_rule(1)).padding([0, 8]).into(), + menu_button!(widget::text(fl!("show-details"))) .on_press(tab::Message::LocationMenuAction( LocationMenuAction::Properties(ancestor_index), ))