╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Threads.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
2173 fn focusDetail(self: *This, index: usize, root_focus: *Focus) !void { 2174 if (self.detailInner(index).children.count() == 0) return; 2175 root_focus.setFocus(self.detailOuter(index).getFocus().id); 2176 } 2177 2178 // return to the list. 2179 fn focusList(self: *This, index: usize, root_focus: *Focus) !void { 2180 root_focus.setFocus(self.listScroll(index).getFocus().id); 2181 } 2182 2183 // cross to the header tabs above the stack. 2184 fn focusHeader(self: *This, root_focus: *Focus) void { 2185 root_focus.setFocus(self.box.children.keys()[header_index]); 2186 } 2187 2188 pub fn clearGrid(self: *This) void { 2189 self.box.clearGrid(); 2190 } 2191 2192 pub fn getGrid(self: This) ?Grid { 2193 return self.box.getGrid(); 2194 } 2195 2196 pub fn getFocus(self: *This) *Focus { 2197 return self.box.getFocus(); 2198 } 2199 2200 // for the parent's "scroll up at the top jumps to the header" check: at the 2201 // top only while the header tabs hold focus, so up from the split 2202 // crosses into the tabs first. 2203 pub fn getSelectedIndex(self: *This) ?usize { 2204 return if (self.headerActive()) 0 else 1; 2205 } 2206 }; 2207 } 2208