feat: Konsole parity phase 1b (layout save/load, SSH bookmarks)
- Serialize pane grid splits and per-tab state to RON - Save/load layout via cosmic-files dialogs with confirmation - SSH submenu from ~/.ssh/config Host entries (no wildcards) - i18n en/fr for layout and SSH menu entries
This commit is contained in:
parent
43d38aed8a
commit
d7cc5aaac1
5 changed files with 439 additions and 15 deletions
43
src/menu.rs
43
src/menu.rs
|
|
@ -219,6 +219,7 @@ pub fn menu_bar<'a>(
|
|||
config: &Config,
|
||||
key_binds: &HashMap<KeyBind, Action>,
|
||||
monitors: (bool, bool, bool),
|
||||
ssh_hosts: &[String],
|
||||
) -> Element<'a, Message> {
|
||||
let mut profile_items = Vec::with_capacity(config.profiles.len());
|
||||
for (name, id) in config.profile_names() {
|
||||
|
|
@ -227,6 +228,32 @@ pub fn menu_bar<'a>(
|
|||
|
||||
//TODO: what to do if there are no profiles?
|
||||
|
||||
let mut file_items = vec![
|
||||
MenuItem::Button(fl!("new-tab"), None, Action::TabNew),
|
||||
MenuItem::Button(fl!("new-window"), None, Action::WindowNew),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Folder(fl!("profile"), profile_items),
|
||||
MenuItem::Button(fl!("menu-profiles"), None, Action::Profiles),
|
||||
MenuItem::Divider,
|
||||
];
|
||||
if !ssh_hosts.is_empty() {
|
||||
let ssh_items = ssh_hosts
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(index, host)| MenuItem::Button(host.clone(), None, Action::SshConnect(index)))
|
||||
.collect();
|
||||
file_items.push(MenuItem::Folder(fl!("ssh"), ssh_items));
|
||||
}
|
||||
file_items.extend([
|
||||
MenuItem::Button(fl!("save-layout"), None, Action::LayoutSave),
|
||||
MenuItem::Button(fl!("load-layout"), None, Action::LayoutLoad),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Button(fl!("rename-tab"), None, Action::TabRename),
|
||||
MenuItem::Button(fl!("close-tab"), None, Action::TabClose),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Button(fl!("quit"), None, Action::WindowClose),
|
||||
]);
|
||||
|
||||
let color_scheme_kind = config.color_scheme_kind(core.system_theme());
|
||||
|
||||
responsive_menu_bar()
|
||||
|
|
@ -239,21 +266,7 @@ pub fn menu_bar<'a>(
|
|||
MENU_ID.clone(),
|
||||
Message::Surface,
|
||||
vec![
|
||||
(
|
||||
fl!("file"),
|
||||
vec![
|
||||
MenuItem::Button(fl!("new-tab"), None, Action::TabNew),
|
||||
MenuItem::Button(fl!("new-window"), None, Action::WindowNew),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Folder(fl!("profile"), profile_items),
|
||||
MenuItem::Button(fl!("menu-profiles"), None, Action::Profiles),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Button(fl!("rename-tab"), None, Action::TabRename),
|
||||
MenuItem::Button(fl!("close-tab"), None, Action::TabClose),
|
||||
MenuItem::Divider,
|
||||
MenuItem::Button(fl!("quit"), None, Action::WindowClose),
|
||||
],
|
||||
),
|
||||
(fl!("file"), file_items),
|
||||
(
|
||||
fl!("edit"),
|
||||
vec![
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue