diff options
| author | Aberter Yan <aberter0x3f@disroot.org> | 2025-05-01 20:36:33 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-01 11:06:34 -0700 |
| commit | eb590c53460c24a23024db192a3132687aabc06d (patch) | |
| tree | d0a8f4171c7b6c9b9d009e2175cfe97bcffee703 /src/ui | |
| parent | 02baad91aca414a9adb9e77b4967d63bb366fb1b (diff) | |
| download | niri-eb590c53460c24a23024db192a3132687aabc06d.tar.gz niri-eb590c53460c24a23024db192a3132687aabc06d.tar.bz2 niri-eb590c53460c24a23024db192a3132687aabc06d.zip | |
Implement --focus for MoveColumnToWorkspace/Up/Down
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/hotkey_overlay.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/hotkey_overlay.rs b/src/ui/hotkey_overlay.rs index 660d569b..1430a9d6 100644 --- a/src/ui/hotkey_overlay.rs +++ b/src/ui/hotkey_overlay.rs @@ -211,33 +211,33 @@ fn render( ]); // Prefer move-column-to-workspace-down, but fall back to move-window-to-workspace-down. - if binds + if let Some(bind) = binds .iter() - .any(|bind| bind.action == Action::MoveColumnToWorkspaceDown) + .find(|bind| matches!(bind.action, Action::MoveColumnToWorkspaceDown(_))) { - actions.push(&Action::MoveColumnToWorkspaceDown); + actions.push(&bind.action); } else if binds .iter() - .any(|bind| bind.action == Action::MoveWindowToWorkspaceDown) + .any(|bind| matches!(bind.action, Action::MoveWindowToWorkspaceDown)) { actions.push(&Action::MoveWindowToWorkspaceDown); } else { - actions.push(&Action::MoveColumnToWorkspaceDown); + actions.push(&Action::MoveColumnToWorkspaceDown(true)); } // Same for -up. - if binds + if let Some(bind) = binds .iter() - .any(|bind| bind.action == Action::MoveColumnToWorkspaceUp) + .find(|bind| matches!(bind.action, Action::MoveColumnToWorkspaceUp(_))) { - actions.push(&Action::MoveColumnToWorkspaceUp); + actions.push(&bind.action); } else if binds .iter() - .any(|bind| bind.action == Action::MoveWindowToWorkspaceUp) + .any(|bind| matches!(bind.action, Action::MoveWindowToWorkspaceUp)) { actions.push(&Action::MoveWindowToWorkspaceUp); } else { - actions.push(&Action::MoveColumnToWorkspaceUp); + actions.push(&Action::MoveColumnToWorkspaceUp(true)); } actions.extend(&[ @@ -424,8 +424,8 @@ fn action_name(action: &Action) -> String { Action::MoveColumnRight => String::from("Move Column Right"), Action::FocusWorkspaceDown => String::from("Switch Workspace Down"), Action::FocusWorkspaceUp => String::from("Switch Workspace Up"), - Action::MoveColumnToWorkspaceDown => String::from("Move Column to Workspace Down"), - Action::MoveColumnToWorkspaceUp => String::from("Move Column to Workspace Up"), + Action::MoveColumnToWorkspaceDown(_) => String::from("Move Column to Workspace Down"), + Action::MoveColumnToWorkspaceUp(_) => String::from("Move Column to Workspace Up"), Action::MoveWindowToWorkspaceDown => String::from("Move Window to Workspace Down"), Action::MoveWindowToWorkspaceUp => String::from("Move Window to Workspace Up"), Action::SwitchPresetColumnWidth => String::from("Switch Preset Column Widths"), |
