╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Header.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
264 rect.y += tabs_rect.y; 265 self.scroll.scrollToRect(rect); 266 } 267 } 268 269 pub fn clearGrid(self: *View) void { 270 self.scroll.clearGrid(); 271 } 272 273 pub fn getGrid(self: View) ?Grid { 274 return self.scroll.getGrid(); 275 } 276 277 pub fn getFocus(self: *View) *Focus { 278 return self.scroll.getFocus(); 279 } 280 281 pub fn getSelectedIndex(self: View) ?usize { 282 return self.currentTabIndex(); 283 } 284 285 fn currentTabIndex(self: View) ?usize { 286 if (self.scroll.child.box.focus.child_id != self.tabs_id) return null; 287 const child_id = self.tabsChild().widget.box.focus.child_id orelse return null; 288 return self.tab_ids.getIndex(child_id); 289 } 290 291 fn tabsChild(self: *const View) *wgt.Box(ui.Widget).Child { 292 return self.scroll.child.box.children.getPtr(self.tabs_id) orelse unreachable; 293 } 294 }; 295