Change Unbind action to Disable to match cosmic-settings

This commit is contained in:
Jeremy Soller 2026-02-05 13:49:05 -07:00
parent 3bb79a36ac
commit f6f8772f5d
3 changed files with 9 additions and 9 deletions

View file

@ -67,6 +67,7 @@ add-another-keybinding = Add another keybinding
cancel = Cancel cancel = Cancel
close-window = Close window close-window = Close window
copy-or-sigint = Copy or SIGINT copy-or-sigint = Copy or SIGINT
disable = Disable
focus-pane-down = Focus pane down focus-pane-down = Focus pane down
focus-pane-left = Focus pane left focus-pane-left = Focus pane left
focus-pane-right = Focus pane right focus-pane-right = Focus pane right
@ -89,7 +90,6 @@ shortcut-replace-title = Replace shortcut?
tab-activate = Activate tab { $number } tab-activate = Activate tab { $number }
toggle-fullscreen = Toggle fullscreen toggle-fullscreen = Toggle fullscreen
type-to-search = Type to search... type-to-search = Type to search...
unbind = Unbind
# Find # Find
find-placeholder = Find... find-placeholder = Find...

View file

@ -2450,7 +2450,7 @@ impl Application for App {
self.shortcuts_config self.shortcuts_config
.custom .custom
.0 .0
.insert(binding, shortcuts::KeyBindAction::Unbind); .insert(binding, shortcuts::KeyBindAction::Disable);
} }
shortcuts::BindingSource::Custom => { shortcuts::BindingSource::Custom => {
self.shortcuts_config.custom.0.remove(&binding); self.shortcuts_config.custom.0.remove(&binding);

View file

@ -56,7 +56,7 @@ impl Binding {
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum KeyBindAction { pub enum KeyBindAction {
Unbind, Disable,
ClearScrollback, ClearScrollback,
Copy, Copy,
CopyOrSigint, CopyOrSigint,
@ -98,7 +98,7 @@ pub enum KeyBindAction {
impl KeyBindAction { impl KeyBindAction {
fn to_action(self) -> Option<Action> { fn to_action(self) -> Option<Action> {
match self { match self {
Self::Unbind => None, Self::Disable => None,
Self::ClearScrollback => Some(Action::ClearScrollback), Self::ClearScrollback => Some(Action::ClearScrollback),
Self::Copy => Some(Action::Copy), Self::Copy => Some(Action::Copy),
Self::CopyOrSigint => Some(Action::CopyOrSigint), Self::CopyOrSigint => Some(Action::CopyOrSigint),
@ -194,7 +194,7 @@ impl ShortcutsConfig {
} }
match self.custom.0.get(binding) { match self.custom.0.get(binding) {
Some(KeyBindAction::Unbind) => { Some(KeyBindAction::Disable) => {
changed = true; changed = true;
} }
Some(custom_action) => { Some(custom_action) => {
@ -230,7 +230,7 @@ impl ShortcutsConfig {
pub fn action_for_binding(&self, binding: &Binding) -> Option<KeyBindAction> { pub fn action_for_binding(&self, binding: &Binding) -> Option<KeyBindAction> {
if let Some(action) = self.custom.0.get(binding) { if let Some(action) = self.custom.0.get(binding) {
if *action == KeyBindAction::Unbind { if *action == KeyBindAction::Disable {
return None; return None;
} }
return Some(*action); return Some(*action);
@ -258,7 +258,7 @@ impl ShortcutsConfig {
pub fn action_label(action: KeyBindAction) -> String { pub fn action_label(action: KeyBindAction) -> String {
match action { match action {
KeyBindAction::Unbind => fl!("unbind"), KeyBindAction::Disable => fl!("disable"),
KeyBindAction::ClearScrollback => fl!("clear-scrollback"), KeyBindAction::ClearScrollback => fl!("clear-scrollback"),
KeyBindAction::Copy => fl!("copy"), KeyBindAction::Copy => fl!("copy"),
KeyBindAction::CopyOrSigint => fl!("copy-or-sigint"), KeyBindAction::CopyOrSigint => fl!("copy-or-sigint"),
@ -406,7 +406,7 @@ pub fn binding_from_key(modifiers: Modifiers, key: Key) -> Option<Binding> {
fn insert_shortcuts( fn insert_shortcuts(
shortcuts: &Shortcuts, shortcuts: &Shortcuts,
binds: &mut HashMap<KeyBind, Action>, binds: &mut HashMap<KeyBind, Action>,
allow_unbind: bool, allow_disable: bool,
) { ) {
for (binding, action) in &shortcuts.0 { for (binding, action) in &shortcuts.0 {
let key_bind = match binding.to_key_bind() { let key_bind = match binding.to_key_bind() {
@ -416,7 +416,7 @@ fn insert_shortcuts(
continue; continue;
} }
}; };
if allow_unbind && *action == KeyBindAction::Unbind { if allow_disable && *action == KeyBindAction::Disable {
binds.remove(&key_bind); binds.remove(&key_bind);
continue; continue;
} }