╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Home.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
146 }, 147 .stack => { 148 if (child.stack.getSelected()) |selected_widget| { 149 const at_top = switch (selected_widget.*) { 150 .home_users => |*v| v.getSelectedIndex() == 0, 151 .home_repos => |*v| v.getSelectedIndex() == 0, 152 .settings => |*v| v.getSelectedIndex() == 0, 153 .auth => |*v| v.getSelectedIndex() == 0, 154 else => false, 155 }; 156 if (at_top) { 157 index = header_index; 158 } else { 159 try child.input(allocator, key, root_focus); 160 } 161 } 162 }, 163 else => {}, 164 } 165 }, 166 .down => { 167 switch (child.*) { 168 .home_header => { 169 index = stack_index; 170 }, 171 .stack => { 172 try child.input(allocator, key, root_focus); 173 }, 174 else => {}, 175 } 176 }, 177 .none => { 178 try child.input(allocator, key, root_focus); 179 }, 180 } 181 182 if (index != current_index) { 183 try root_focus.setFocus(self.box.children.keys()[index]); 184 } 185 } 186 } 187 } 188 189 pub fn clearGrid(self: *View) void { 190 self.box.clearGrid(); 191 } 192 193 pub fn getGrid(self: View) ?Grid { 194 return self.box.getGrid(); 195 } 196 197 pub fn getFocus(self: *View) *Focus { 198 return self.box.getFocus(); 199 } 200 }; 201