diff --git a/i18n/en/cosmic_term.ftl b/i18n/en/cosmic_term.ftl index 2becb3c..00d892c 100644 --- a/i18n/en/cosmic_term.ftl +++ b/i18n/en/cosmic_term.ftl @@ -67,6 +67,7 @@ add-another-keybinding = Add another keybinding cancel = Cancel close-window = Close window copy-or-sigint = Copy or SIGINT +disable = Disable focus-pane-down = Focus pane down focus-pane-left = Focus pane left focus-pane-right = Focus pane right @@ -89,7 +90,6 @@ shortcut-replace-title = Replace shortcut? tab-activate = Activate tab { $number } toggle-fullscreen = Toggle fullscreen type-to-search = Type to search... -unbind = Unbind # Find find-placeholder = Find... diff --git a/src/main.rs b/src/main.rs index 58b44e7..22dcb69 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2450,7 +2450,7 @@ impl Application for App { self.shortcuts_config .custom .0 - .insert(binding, shortcuts::KeyBindAction::Unbind); + .insert(binding, shortcuts::KeyBindAction::Disable); } shortcuts::BindingSource::Custom => { self.shortcuts_config.custom.0.remove(&binding); diff --git a/src/shortcuts.rs b/src/shortcuts.rs index 7e922e9..427ed19 100644 --- a/src/shortcuts.rs +++ b/src/shortcuts.rs @@ -56,7 +56,7 @@ impl Binding { #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)] pub enum KeyBindAction { - Unbind, + Disable, ClearScrollback, Copy, CopyOrSigint, @@ -98,7 +98,7 @@ pub enum KeyBindAction { impl KeyBindAction { fn to_action(self) -> Option { match self { - Self::Unbind => None, + Self::Disable => None, Self::ClearScrollback => Some(Action::ClearScrollback), Self::Copy => Some(Action::Copy), Self::CopyOrSigint => Some(Action::CopyOrSigint), @@ -194,7 +194,7 @@ impl ShortcutsConfig { } match self.custom.0.get(binding) { - Some(KeyBindAction::Unbind) => { + Some(KeyBindAction::Disable) => { changed = true; } Some(custom_action) => { @@ -230,7 +230,7 @@ impl ShortcutsConfig { pub fn action_for_binding(&self, binding: &Binding) -> Option { if let Some(action) = self.custom.0.get(binding) { - if *action == KeyBindAction::Unbind { + if *action == KeyBindAction::Disable { return None; } return Some(*action); @@ -258,7 +258,7 @@ impl ShortcutsConfig { pub fn action_label(action: KeyBindAction) -> String { match action { - KeyBindAction::Unbind => fl!("unbind"), + KeyBindAction::Disable => fl!("disable"), KeyBindAction::ClearScrollback => fl!("clear-scrollback"), KeyBindAction::Copy => fl!("copy"), KeyBindAction::CopyOrSigint => fl!("copy-or-sigint"), @@ -406,7 +406,7 @@ pub fn binding_from_key(modifiers: Modifiers, key: Key) -> Option { fn insert_shortcuts( shortcuts: &Shortcuts, binds: &mut HashMap, - allow_unbind: bool, + allow_disable: bool, ) { for (binding, action) in &shortcuts.0 { let key_bind = match binding.to_key_bind() { @@ -416,7 +416,7 @@ fn insert_shortcuts( continue; } }; - if allow_unbind && *action == KeyBindAction::Unbind { + if allow_disable && *action == KeyBindAction::Disable { binds.remove(&key_bind); continue; }