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