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