╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ User.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
506 return &self.box.children.values()[header_index].widget.header_scroll.row().children.values()[0].widget.search_box; 507 } 508 509 fn listScroll(self: *ReposView) *ui.widget.FlowBox.Scroll { 510 return &self.box.children.values()[list_index].widget.flow_box_scroll; 511 } 512 513 fn headerActive(self: *ReposView) bool { 514 return self.box.getFocus().child_id == self.box.children.keys()[header_index]; 515 } 516 517 pub fn clearGrid(self: *ReposView) void { 518 self.box.clearGrid(); 519 } 520 521 pub fn getGrid(self: ReposView) ?Grid { 522 return self.box.getGrid(); 523 } 524 525 pub fn getFocus(self: *ReposView) *Focus { 526 return self.box.getFocus(); 527 } 528 529 // up leaves the tab from the search box 530 pub fn atTop(self: *ReposView) bool { 531 return self.headerActive(); 532 } 533 534 pub fn focusHeader(self: *ReposView, root_focus: *Focus) void { 535 root_focus.setFocus(self.searchBox().getFocus().id); 536 } 537 }; 538 539 // the first window of `name`'s repos 540 fn reposRoute(name: []const u8) ?ui.RoutablePage { 541 return .{ .user_repos = .{ .name = ui.RoutablePage.Array(evt.User.name_max_len).from(name) orelse return null } }; 542 } 543