╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Threads.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2198 fn focusToolRow(self: *This, index: usize, root_focus: *Focus) void { 2199 const cid = self.toolRow(index).getFocus().child_id orelse return self.focusHeader(root_focus); 2200 root_focus.setFocus(cid); 2201 } 2202 2203 // enter the detail pane. an empty pane (no issues) can't be entered. 2204 fn focusDetail(self: *This, index: usize, root_focus: *Focus) !void { 2205 if (self.detailInner(index).children.count() == 0) return; 2206 root_focus.setFocus(self.detailOuter(index).getFocus().id); 2207 } 2208 2209 // return to the list. 2210 fn focusList(self: *This, index: usize, root_focus: *Focus) !void { 2211 root_focus.setFocus(self.listScroll(index).getFocus().id); 2212 } 2213 2214 // cross to the header tabs above the stack. 2215 fn focusHeader(self: *This, root_focus: *Focus) void { 2216 root_focus.setFocus(self.box.children.keys()[header_index]); 2217 } 2218 2219 pub fn clearGrid(self: *This) void { 2220 self.box.clearGrid(); 2221 } 2222 2223 pub fn getGrid(self: This) ?Grid { 2224 return self.box.getGrid(); 2225 } 2226 2227 pub fn getFocus(self: *This) *Focus { 2228 return self.box.getFocus(); 2229 } 2230 2231 // for the parent's "scroll up at the top jumps to the header" check: at the 2232 // top only while the header tabs hold focus, so up from the split 2233 // crosses into the tabs first. 2234 pub fn getSelectedIndex(self: *This) ?usize { 2235 return if (self.headerActive()) 0 else 1; 2236 } 2237 }; 2238 } 2239