╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
154 155 pub fn input(self: *View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 156 _ = allocator; 157 const current_tab = self.currentTabIndex() orelse return; 158 if (inp.moveTab(key, current_tab, self.tab_ids.count())) |new_tab| { 159 root_focus.setFocus(self.tab_ids.keys()[new_tab]); 160 } 161 } 162 163 pub fn clearGrid(self: *View) void { 164 self.box.clearGrid(); 165 } 166 167 pub fn getGrid(self: View) ?Grid { 168 return self.box.getGrid(); 169 } 170 171 pub fn getFocus(self: *View) *Focus { 172 return self.box.getFocus(); 173 } 174 175 pub fn getSelectedIndex(self: View) ?usize { 176 return self.currentTabIndex(); 177 } 178 179 fn currentTabIndex(self: View) ?usize { 180 const child_id = self.box.focus.child_id orelse return null; 181 return self.tab_ids.getIndex(child_id); 182 } 183 }; 184