╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
268 } 269 270 pub fn getFocus(self: *View) *Focus { 271 return self.scroll.getFocus(); 272 } 273 274 pub fn getSelectedIndex(self: View) ?usize { 275 return self.currentTabIndex(); 276 } 277 278 fn currentTabIndex(self: View) ?usize { 279 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 280 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 281 return self.tab_ids.getIndex(child_id); 282 } 283 284 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 285 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 286 } 287 }; 288