╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
241 } 242 243 pub fn getGrid(self: View) ?Grid { 244 return self.scroll.getGrid(); 245 } 246 247 pub fn getFocus(self: *View) *Focus { 248 return self.scroll.getFocus(); 249 } 250 251 pub fn getSelectedIndex(self: View) ?usize { 252 return self.currentTabIndex(); 253 } 254 255 fn currentTabIndex(self: View) ?usize { 256 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 257 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 258 return self.tab_ids.getIndex(child_id); 259 } 260 261 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 262 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 263 } 264 }; 265