╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
482 } 483 484 pub fn getGrid(self: View) ?Grid { 485 return self.scroll.getGrid(); 486 } 487 488 pub fn getFocus(self: *View) *Focus { 489 return self.scroll.getFocus(); 490 } 491 492 pub fn getSelectedIndex(self: View) ?usize { 493 return self.currentTabIndex(); 494 } 495 496 fn currentTabIndex(self: View) ?usize { 497 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 498 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 499 return self.tab_ids.getIndex(child_id); 500 } 501 502 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 503 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 504 } 505 }; 506