Merge pull request #316 from git-f0x/master
Add missing File menu entries
This commit is contained in:
commit
ca1168ddf5
4 changed files with 32 additions and 25 deletions
|
|
@ -94,20 +94,20 @@ renamed = Renamed {$from} to {$to}
|
||||||
restoring = Restoring {$items} {$items ->
|
restoring = Restoring {$items} {$items ->
|
||||||
[one] item
|
[one] item
|
||||||
*[other] items
|
*[other] items
|
||||||
} from {trash}
|
} from {trash}
|
||||||
restored = Restored {$items} {$items ->
|
restored = Restored {$items} {$items ->
|
||||||
[one] item
|
[one] item
|
||||||
*[other] items
|
*[other] items
|
||||||
} from {trash}
|
} from {trash}
|
||||||
undo = Undo
|
undo = Undo
|
||||||
unknown-folder = unknown folder
|
unknown-folder = unknown folder
|
||||||
|
|
||||||
## Open with
|
## Open with
|
||||||
open-with = Open with
|
open-with = Open with...
|
||||||
default-app = {$name} (default)
|
default-app = {$name} (default)
|
||||||
|
|
||||||
## Properties
|
## Show details
|
||||||
properties = Properties
|
show-details = Show details
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
settings = Settings
|
settings = Settings
|
||||||
|
|
@ -130,8 +130,8 @@ light = Light
|
||||||
|
|
||||||
# Context menu
|
# Context menu
|
||||||
add-to-sidebar = Add to sidebar
|
add-to-sidebar = Add to sidebar
|
||||||
new-file = New file
|
new-file = New file...
|
||||||
new-folder = New folder
|
new-folder = New folder...
|
||||||
open-in-terminal = Open in terminal
|
open-in-terminal = Open in terminal
|
||||||
move-to-trash = Move to trash
|
move-to-trash = Move to trash
|
||||||
restore-from-trash = Restore from trash
|
restore-from-trash = Restore from trash
|
||||||
|
|
@ -146,7 +146,8 @@ sort-by-size = Sort by size
|
||||||
file = File
|
file = File
|
||||||
new-tab = New tab
|
new-tab = New tab
|
||||||
new-window = New window
|
new-window = New window
|
||||||
rename = Rename
|
rename = Rename...
|
||||||
|
menu-show-details = Show details...
|
||||||
close-tab = Close tab
|
close-tab = Close tab
|
||||||
quit = Quit
|
quit = Quit
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ impl ContextPage {
|
||||||
Self::About => String::new(),
|
Self::About => String::new(),
|
||||||
Self::EditHistory => fl!("edit-history"),
|
Self::EditHistory => fl!("edit-history"),
|
||||||
Self::OpenWith => fl!("open-with"),
|
Self::OpenWith => fl!("open-with"),
|
||||||
Self::Properties(..) => fl!("properties"),
|
Self::Properties(..) => String::default(),
|
||||||
Self::Settings => fl!("settings"),
|
Self::Settings => fl!("settings"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1087,7 +1087,7 @@ impl Application for App {
|
||||||
),
|
),
|
||||||
cosmic::widget::menu::Item::Divider,
|
cosmic::widget::menu::Item::Divider,
|
||||||
cosmic::widget::menu::Item::Button(
|
cosmic::widget::menu::Item::Button(
|
||||||
fl!("properties"),
|
fl!("show-details"),
|
||||||
NavMenuAction::Properties(id),
|
NavMenuAction::Properties(id),
|
||||||
),
|
),
|
||||||
cosmic::widget::menu::Item::Divider,
|
cosmic::widget::menu::Item::Divider,
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bind!([Ctrl], Key::Character("d".into()), AddToSidebar);
|
||||||
bind!([Ctrl], Key::Character("c".into()), Copy);
|
bind!([Ctrl], Key::Character("c".into()), Copy);
|
||||||
bind!([Ctrl], Key::Character("x".into()), Cut);
|
bind!([Ctrl], Key::Character("x".into()), Cut);
|
||||||
bind!([Ctrl], Key::Character("l".into()), EditLocation);
|
bind!([Ctrl], Key::Character("l".into()), EditLocation);
|
||||||
|
|
@ -49,6 +50,7 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
|
||||||
bind!([], Key::Named(Named::F2), Rename);
|
bind!([], Key::Named(Named::F2), Rename);
|
||||||
bind!([Ctrl], Key::Character("f".into()), SearchActivate);
|
bind!([Ctrl], Key::Character("f".into()), SearchActivate);
|
||||||
bind!([Ctrl], Key::Character("a".into()), SelectAll);
|
bind!([Ctrl], Key::Character("a".into()), SelectAll);
|
||||||
|
bind!([Ctrl], Key::Character(",".into()), Settings);
|
||||||
bind!([Ctrl], Key::Character("w".into()), TabClose);
|
bind!([Ctrl], Key::Character("w".into()), TabClose);
|
||||||
bind!([Ctrl], Key::Character("t".into()), TabNew);
|
bind!([Ctrl], Key::Character("t".into()), TabNew);
|
||||||
bind!([Ctrl], Key::Named(Named::Tab), TabNext);
|
bind!([Ctrl], Key::Named(Named::Tab), TabNext);
|
||||||
|
|
|
||||||
34
src/menu.rs
34
src/menu.rs
|
|
@ -5,6 +5,7 @@ use cosmic::{
|
||||||
iced::{widget::horizontal_rule, Alignment, Background, Border, Length},
|
iced::{widget::horizontal_rule, Alignment, Background, Border, Length},
|
||||||
theme,
|
theme,
|
||||||
widget,
|
widget,
|
||||||
|
widget::container,
|
||||||
widget::menu::{self, key_bind::KeyBind, ItemHeight, ItemWidth, MenuBar},
|
widget::menu::{self, key_bind::KeyBind, ItemHeight, ItemWidth, MenuBar},
|
||||||
Element,
|
Element,
|
||||||
};
|
};
|
||||||
|
|
@ -109,17 +110,16 @@ pub fn context_menu<'a>(
|
||||||
children
|
children
|
||||||
.push(menu_item(fl!("open-in-new-window"), Action::OpenInNewWindow).into());
|
.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!("rename"), Action::Rename).into());
|
||||||
children.push(menu_item(fl!("cut"), Action::Cut).into());
|
children.push(menu_item(fl!("cut"), Action::Cut).into());
|
||||||
children.push(menu_item(fl!("copy"), Action::Copy).into());
|
children.push(menu_item(fl!("copy"), Action::Copy).into());
|
||||||
//TODO: Print?
|
//TODO: Print?
|
||||||
children.push(horizontal_rule(1).into());
|
children.push(container(horizontal_rule(1)).padding([0, 8]).into());
|
||||||
//TODO: change to Show details
|
children.push(menu_item(fl!("show-details"), Action::Properties).into());
|
||||||
children.push(menu_item(fl!("properties"), Action::Properties).into());
|
children.push(container(horizontal_rule(1)).padding([0, 8]).into());
|
||||||
children.push(horizontal_rule(1).into());
|
|
||||||
children.push(menu_item(fl!("add-to-sidebar"), Action::AddToSidebar).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());
|
children.push(menu_item(fl!("move-to-trash"), Action::MoveToTrash).into());
|
||||||
} else {
|
} else {
|
||||||
//TODO: need better designs for menu with no selection
|
//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-file"), Action::NewFile).into());
|
||||||
children.push(menu_item(fl!("new-folder"), Action::NewFolder).into());
|
children.push(menu_item(fl!("new-folder"), Action::NewFolder).into());
|
||||||
children.push(menu_item(fl!("open-in-terminal"), Action::OpenTerminal).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!("select-all"), Action::SelectAll).into());
|
||||||
children.push(menu_item(fl!("paste"), Action::Paste).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
|
// TODO: Nested menu
|
||||||
children.push(sort_item(fl!("sort-by-name"), HeadingOptions::Name));
|
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-modified"), HeadingOptions::Modified));
|
||||||
|
|
@ -140,13 +140,13 @@ pub fn context_menu<'a>(
|
||||||
Location::Trash => {
|
Location::Trash => {
|
||||||
children.push(menu_item(fl!("select-all"), Action::SelectAll).into());
|
children.push(menu_item(fl!("select-all"), Action::SelectAll).into());
|
||||||
if selected > 0 {
|
if selected > 0 {
|
||||||
children.push(horizontal_rule(1).into());
|
children.push(container(horizontal_rule(1)).padding([0, 8]).into());
|
||||||
children.push(menu_item(fl!("properties"), Action::Properties).into());
|
children.push(menu_item(fl!("show-details"), Action::Properties).into());
|
||||||
children.push(horizontal_rule(1).into());
|
children.push(container(horizontal_rule(1)).padding([0, 8]).into());
|
||||||
children
|
children
|
||||||
.push(menu_item(fl!("restore-from-trash"), Action::RestoreFromTrash).into());
|
.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
|
// TODO: Nested menu
|
||||||
children.push(sort_item(fl!("sort-by-name"), HeadingOptions::Name));
|
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-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-file"), Action::NewFile),
|
||||||
menu::Item::Button(fl!("new-folder"), Action::NewFolder),
|
menu::Item::Button(fl!("new-folder"), Action::NewFolder),
|
||||||
menu::Item::Button(fl!("open"), Action::Open),
|
menu::Item::Button(fl!("open"), Action::Open),
|
||||||
|
menu::Item::Button(fl!("open-with"), Action::OpenWith),
|
||||||
menu::Item::Divider,
|
menu::Item::Divider,
|
||||||
menu::Item::Button(fl!("rename"), Action::Rename),
|
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::Divider,
|
||||||
menu::Item::Button(fl!("move-to-trash"), Action::MoveToTrash),
|
menu::Item::Button(fl!("move-to-trash"), Action::MoveToTrash),
|
||||||
menu::Item::Divider,
|
menu::Item::Divider,
|
||||||
|
|
@ -272,8 +276,8 @@ pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Mess
|
||||||
LocationMenuAction::OpenInNewWindow(ancestor_index),
|
LocationMenuAction::OpenInNewWindow(ancestor_index),
|
||||||
))
|
))
|
||||||
.into(),
|
.into(),
|
||||||
horizontal_rule(1).into(),
|
container(horizontal_rule(1)).padding([0, 8]).into(),
|
||||||
menu_button!(widget::text(fl!("properties")))
|
menu_button!(widget::text(fl!("show-details")))
|
||||||
.on_press(tab::Message::LocationMenuAction(
|
.on_press(tab::Message::LocationMenuAction(
|
||||||
LocationMenuAction::Properties(ancestor_index),
|
LocationMenuAction::Properties(ancestor_index),
|
||||||
))
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue