╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Threads.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2516 2517 // return to the tool row's last-focused button (the header when the 2518 // description page shows no row). 2519 fn focusToolRow(self: *This, index: usize, root_focus: *Focus) void { 2520 const cid = self.toolRow(index).getFocus().child_id orelse return self.focusHeader(root_focus); 2521 root_focus.setFocus(cid); 2522 } 2523 2524 // enter the detail pane. an empty pane can't be entered. 2525 fn focusDetail(self: *This, index: usize, root_focus: *Focus) void { 2526 if (self.detailInner(index).children.count() == 0) return; 2527 root_focus.setFocus(self.detailOuter(index).getFocus().id); 2528 } 2529 2530 // return to the list. 2531 fn focusList(self: *This, index: usize, root_focus: *Focus) void { 2532 root_focus.setFocus(self.listScroll(index).getFocus().id); 2533 } 2534 2535 // cross to the header tabs above the stack. 2536 fn focusHeader(self: *This, root_focus: *Focus) void { 2537 root_focus.setFocus(self.box.children.keys()[header_index]); 2538 } 2539 2540 pub fn clearGrid(self: *This) void { 2541 self.box.clearGrid(); 2542 } 2543 2544 pub fn getGrid(self: This) ?Grid { 2545 return self.box.getGrid(); 2546 } 2547 2548 pub fn getFocus(self: *This) *Focus { 2549 return self.box.getFocus(); 2550 } 2551 2552 // for the parent's "scroll up at the top jumps to the header" check: at the 2553 // top only while the header tabs hold focus, so up from the split 2554 // crosses into the tabs first. 2555 pub fn getSelectedIndex(self: *This) ?usize { 2556 return if (self.headerActive()) 0 else 1; 2557 } 2558 }; 2559 } 2560