╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
285 } 286 287 pub fn getFocus(self: *View) *Focus { 288 return self.scroll.getFocus(); 289 } 290 291 pub fn getSelectedIndex(self: View) ?usize { 292 return self.currentTabIndex(); 293 } 294 295 fn currentTabIndex(self: View) ?usize { 296 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 297 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 298 return self.tab_ids.getIndex(child_id); 299 } 300 301 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 302 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 303 } 304 }; 305