migrate options tab to new keybindings
This commit is contained in:
parent
0b2dad0cf1
commit
4b4b954a64
2 changed files with 0 additions and 37 deletions
17
src/tui.zig
17
src/tui.zig
|
|
@ -1379,23 +1379,6 @@ pub const App = struct {
|
|||
self.reloadPortfolioFile();
|
||||
return ctx.consumeAndRedraw();
|
||||
},
|
||||
.collapse_all_puts => {
|
||||
if (self.active_tab == .options) {
|
||||
tab_modules.options.tab.handleAction(&self.states.options, self, tab_modules.options.Action.collapse_all_puts);
|
||||
return ctx.consumeAndRedraw();
|
||||
}
|
||||
},
|
||||
.options_filter_1, .options_filter_2, .options_filter_3, .options_filter_4, .options_filter_5, .options_filter_6, .options_filter_7, .options_filter_8, .options_filter_9 => {
|
||||
if (self.active_tab == .options) {
|
||||
const n = @intFromEnum(action) - @intFromEnum(keybinds.Action.options_filter_1) + 1;
|
||||
// Route through tab.handleAction so the dispatch
|
||||
// table is consistent with the framework. Each
|
||||
// filter_N maps directly to tab_modules.options.Action.filter_N.
|
||||
const tab_action: tab_modules.options.Action = @enumFromInt(@intFromEnum(tab_modules.options.Action.filter_1) + n - 1);
|
||||
tab_modules.options.tab.handleAction(&self.states.options, self, tab_action);
|
||||
return ctx.consumeAndRedraw();
|
||||
}
|
||||
},
|
||||
.sort_col_next => {
|
||||
if (self.active_tab == .portfolio) {
|
||||
tab_modules.portfolio.tab.handleAction(&self.states.portfolio, self, tab_modules.portfolio.Action.sort_col_next);
|
||||
|
|
|
|||
|
|
@ -27,16 +27,6 @@ pub const Action = enum {
|
|||
symbol_input,
|
||||
help,
|
||||
reload_portfolio,
|
||||
collapse_all_puts,
|
||||
options_filter_1,
|
||||
options_filter_2,
|
||||
options_filter_3,
|
||||
options_filter_4,
|
||||
options_filter_5,
|
||||
options_filter_6,
|
||||
options_filter_7,
|
||||
options_filter_8,
|
||||
options_filter_9,
|
||||
sort_col_next,
|
||||
sort_col_prev,
|
||||
sort_reverse,
|
||||
|
|
@ -169,16 +159,6 @@ pub const global_default_bindings = [_]Binding{
|
|||
.{ .action = .symbol_input, .key = .{ .codepoint = '/' } },
|
||||
.{ .action = .help, .key = .{ .codepoint = '?' } },
|
||||
.{ .action = .reload_portfolio, .key = .{ .codepoint = 'R' } },
|
||||
.{ .action = .collapse_all_puts, .key = .{ .codepoint = 'p' } },
|
||||
.{ .action = .options_filter_1, .key = .{ .codepoint = '1', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_2, .key = .{ .codepoint = '2', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_3, .key = .{ .codepoint = '3', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_4, .key = .{ .codepoint = '4', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_5, .key = .{ .codepoint = '5', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_6, .key = .{ .codepoint = '6', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_7, .key = .{ .codepoint = '7', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_8, .key = .{ .codepoint = '8', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .options_filter_9, .key = .{ .codepoint = '9', .mods = .{ .ctrl = true } } },
|
||||
.{ .action = .sort_col_next, .key = .{ .codepoint = '>' } },
|
||||
.{ .action = .sort_col_prev, .key = .{ .codepoint = '<' } },
|
||||
.{ .action = .sort_reverse, .key = .{ .codepoint = 'o' } },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue