╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
305 self.scroll.clearGrid(); 306 } 307 308 pub fn getGrid(self: View) ?Grid { 309 return self.scroll.getGrid(); 310 } 311 312 pub fn getFocus(self: *View) *Focus { 313 return self.scroll.getFocus(); 314 } 315 316 pub fn getSelectedIndex(self: View) ?usize { 317 return self.currentTabIndex(); 318 } 319 320 fn currentTabIndex(self: View) ?usize { 321 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 322 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 323 return self.tab_ids.getIndex(child_id); 324 } 325 326 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 327 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 328 } 329 }; 330