╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
294 return self.scroll.getGrid(); 295 } 296 297 pub fn getFocus(self: *View) *Focus { 298 return self.scroll.getFocus(); 299 } 300 301 pub fn getSelectedIndex(self: View) ?usize { 302 return self.currentTabIndex(); 303 } 304 305 fn currentTabIndex(self: View) ?usize { 306 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 307 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 308 return self.tab_ids.getIndex(child_id); 309 } 310 311 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 312 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 313 } 314 }; 315