feat: add keybinds for tabs 1-10 (0 for 10th)

This commit is contained in:
Kristofers Solo 2026-01-01 04:56:08 +02:00
parent c8b7d0ccbe
commit 691e30b4a4
Signed by: kristoferssolo
GPG Key ID: 8687F2D3EEE6F0ED
3 changed files with 16 additions and 1 deletions

View File

@ -14,12 +14,17 @@ next_torrent = "j"
prev_tab = "h" prev_tab = "h"
next_tab = "l" next_tab = "l"
# Tab switching # Tab switching (1-9, 0 for 10th)
switch_tab_1 = "1" switch_tab_1 = "1"
switch_tab_2 = "2" switch_tab_2 = "2"
switch_tab_3 = "3" switch_tab_3 = "3"
switch_tab_4 = "4" switch_tab_4 = "4"
switch_tab_5 = "5" switch_tab_5 = "5"
switch_tab_6 = "6"
switch_tab_7 = "7"
switch_tab_8 = "8"
switch_tab_9 = "9"
switch_tab_10 = "0"
# Torrent actions # Torrent actions
toggle_torrent = "enter" toggle_torrent = "enter"

View File

@ -12,6 +12,11 @@ pub struct KeybindsConfig {
pub switch_tab_3: String, pub switch_tab_3: String,
pub switch_tab_4: String, pub switch_tab_4: String,
pub switch_tab_5: String, pub switch_tab_5: String,
pub switch_tab_6: String,
pub switch_tab_7: String,
pub switch_tab_8: String,
pub switch_tab_9: String,
pub switch_tab_10: String,
pub toggle_torrent: String, pub toggle_torrent: String,
pub toggle_all: String, pub toggle_all: String,
pub delete: String, pub delete: String,

View File

@ -60,6 +60,11 @@ pub async fn get_action(key_event: KeyEvent, app: &mut App) -> Result<Option<Act
(Action::SwitchTab(2), &keybinds.switch_tab_3), (Action::SwitchTab(2), &keybinds.switch_tab_3),
(Action::SwitchTab(3), &keybinds.switch_tab_4), (Action::SwitchTab(3), &keybinds.switch_tab_4),
(Action::SwitchTab(4), &keybinds.switch_tab_5), (Action::SwitchTab(4), &keybinds.switch_tab_5),
(Action::SwitchTab(5), &keybinds.switch_tab_6),
(Action::SwitchTab(6), &keybinds.switch_tab_7),
(Action::SwitchTab(7), &keybinds.switch_tab_8),
(Action::SwitchTab(8), &keybinds.switch_tab_9),
(Action::SwitchTab(9), &keybinds.switch_tab_10),
(Action::ToggleTorrent, &keybinds.toggle_torrent), (Action::ToggleTorrent, &keybinds.toggle_torrent),
(Action::ToggleAll, &keybinds.toggle_all), (Action::ToggleAll, &keybinds.toggle_all),
(Action::Delete(false), &keybinds.delete), (Action::Delete(false), &keybinds.delete),