╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
156 return self.box.getGrid(); 157 } 158 159 pub fn getFocus(self: *View) *Focus { 160 return self.box.getFocus(); 161 } 162 163 pub fn getSelectedIndex(self: View) ?usize { 164 return self.currentTabIndex(); 165 } 166 167 fn currentTabIndex(self: View) ?usize { 168 const child_id = self.box.focus.child_id orelse return null; 169 for (self.tab_ids, 0..) |id, i| { 170 if (id == child_id) return i; 171 } 172 return null; 173 } 174 }; 175