╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ User.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
462 } 463 464 fn listScroll(self: *ReposView) *ui.widget.FlowBox.Scroll { 465 return &self.box.children.values()[list_index].widget.flow_box_scroll; 466 } 467 468 fn headerActive(self: *ReposView) bool { 469 return self.box.getFocus().child_id == self.box.children.keys()[header_index]; 470 } 471 472 pub fn clearGrid(self: *ReposView) void { 473 self.box.clearGrid(); 474 } 475 476 pub fn getGrid(self: ReposView) ?Grid { 477 return self.box.getGrid(); 478 } 479 480 pub fn getFocus(self: *ReposView) *Focus { 481 return self.box.getFocus(); 482 } 483 484 // up leaves the tab from the search box 485 pub fn atTop(self: *ReposView) bool { 486 return self.headerActive(); 487 } 488 489 pub fn focusHeader(self: *ReposView, root_focus: *Focus) void { 490 root_focus.setFocus(self.searchBox().getFocus().id); 491 } 492 }; 493 494 // the first window of `name`'s repos 495 fn reposRoute(name: []const u8) ?ui.RoutablePage { 496 return .{ .user_repos = .{ .name = ui.RoutablePage.Array(evt.User.name_max_len).from(name) orelse return null } }; 497 } 498