╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Issues.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2676 try self.box.build(allocator, constraint, root_focus); 2677 } 2678 2679 pub fn input(self: *Header, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void { 2680 _ = allocator; 2681 const current_tab = self.currentTabIndex() orelse return; 2682 if (inp.moveTab(key, current_tab, self.tab_ids.count())) |new_tab| { 2683 root_focus.setFocus(self.tab_ids.keys()[new_tab]); 2684 } 2685 } 2686 2687 pub fn clearGrid(self: *Header) void { 2688 self.box.clearGrid(); 2689 } 2690 2691 pub fn getGrid(self: Header) ?Grid { 2692 return self.box.getGrid(); 2693 } 2694 2695 pub fn getFocus(self: *Header) *Focus { 2696 return self.box.getFocus(); 2697 } 2698 2699 pub fn getSelectedIndex(self: Header) ?usize { 2700 return self.currentTabIndex(); 2701 } 2702 2703 fn currentTabIndex(self: Header) ?usize { 2704 const child_id = self.box.focus.child_id orelse return null; 2705 return self.tab_ids.getIndex(child_id); 2706 } 2707 }; 2708