╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
451 } 452 453 pub fn clearGrid(self: *View) void { 454 self.scroll.clearGrid(); 455 } 456 457 pub fn getGrid(self: View) ?Grid { 458 return self.scroll.getGrid(); 459 } 460 461 pub fn getFocus(self: *View) *Focus { 462 return self.scroll.getFocus(); 463 } 464 465 pub fn getSelectedIndex(self: View) ?usize { 466 return self.currentTabIndex(); 467 } 468 469 fn currentTabIndex(self: View) ?usize { 470 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 471 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 472 return self.tab_ids.getIndex(child_id); 473 } 474 475 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 476 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 477 } 478 }; 479