╭ changed ───────────────╮ │src/ui/Repo/Settings.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │177 if (self.formBox().children.values()[next].widget != .text_box) break; │ │178 } │ │179 root_focus.setFocus(keys[next]); │ │180 - if (self.session.is_terminal) self.scrollToChild(next); │ │180 + if (self.session.is_terminal) if (self.formBox().children.values()[next].rect) |rect| ui.widget.scrollToCenteredRect(&self.scroll, rect);│ │181 return; │ │182 } │ │183 switch (key) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │190 try child.widget.input(allocator, key, root_focus); │ │191 } │ │192 │ │193 - // keep the form child at `index` in view, its rect shifted by the centering │ │194 - fn scrollToChild(self: *View, index: usize) void { │ │195 - const rect = self.formBox().children.values()[index].rect orelse return; │ │196 - const center_grid = self.scroll.child.center.getGrid() orelse return; │ │197 - const form_grid = self.formBox().getGrid() orelse return; │ │198 - const offset_y: isize = @intCast((center_grid.size.height -| form_grid.size.height) / 2);│ │199 - self.scroll.scrollToRect(.{ .x = rect.x, .y = rect.y + offset_y, .size = rect.size }); │ │200 - } │ │201 - │ │193 fn formRadio(form: *wgt.Box(ui.Widget), name: []const u8) !*ui.widget.Radio { │ │194 for (form.children.values()) |*child| switch (child.widget) { │ │195 .radio => |*radio| if (std.mem.eql(u8, radio.name, name)) return radio, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯