╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │362 if (width == 0) return; │ │365 - self.grid = try Grid.init(self.allocator, .{ .width = width, .height = 1 }); │ │363 + self.grid = try Grid.init(allocator, .{ .width = width, .height = 1 }); │ │364 } │ │365 │ │368 - pub fn input(self: *Spacer, key: inp.Key, root_focus: *Focus) !void { │ │366 + pub fn input(self: *Spacer, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │367 _ = self; │ │368 + _ = allocator; │ │369 _ = key; │ │370 _ = root_focus; │ │371 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │389 // a single-child wrapper that builds the child at its natural size and│ │390 // positions its grid in the middle of the area granted by the parent │ │391 pub const Center = struct { │ │393 - allocator: std.mem.Allocator, │ │392 focus: Focus, │ │393 grid: ?Grid, │ │394 child: *Widget, │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │401 errdefer allocator.destroy(child); │ │402 child.* = child_widget; │ │403 return .{ │ │406 - .allocator = allocator, │ │404 .focus = Focus.init(allocator, .container),│ │405 .grid = null, │ │406 .child = child, │ ╰────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │408 }; │ │409 } │ │410 │ │414 - pub fn deinit(self: *Center) void { │ │411 + pub fn deinit(self: *Center, allocator: std.mem.Allocator) void {│ │412 self.focus.deinit(); │ │413 if (self.grid) |*grid| { │ │414 grid.deinit(); │ ╰──────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │415 self.grid = null; │ │416 } │ │420 - self.child.deinit(); │ │421 - self.allocator.destroy(self.child); │ │417 + self.child.deinit(allocator); │ │418 + allocator.destroy(self.child); │ │419 } │ │420 │ │424 - pub fn build(self: *Center, constraint: layout.Constraint, root_focus: *Focus) !void { │ │421 + pub fn build(self: *Center, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │422 self.clearGrid(); │ │423 self.getFocus().clear(); │ │424 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │425 // build the child without forcing it to fill min_size; it sizes│ │426 // itself to its content within the available max. │ │430 - try self.child.build(.{ │ │427 + try self.child.build(allocator, .{ │ │428 .min_size = .{ .width = null, .height = null }, │ │429 .max_size = constraint.max_size, │ │430 }, root_focus); │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │444 else │ │445 0; │ │446 │ │450 - var grid = try Grid.init(self.allocator, .{ .width = width, .height = height }); │ │447 + var grid = try Grid.init(allocator, .{ .width = width, .height = height }); │ │448 errdefer grid.deinit(); │ │449 try grid.drawGrid(child_grid, offset_x, offset_y); │ │450 try self.getFocus().addChild(self.child.getFocus(), child_grid.size, offset_x, offset_y);│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │453 self.grid = grid; │ │454 } │ │455 │ │459 - pub fn input(self: *Center, key: inp.Key, root_focus: *Focus) !void { │ │460 - try self.child.input(key, root_focus); │ │456 + pub fn input(self: *Center, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │457 + try self.child.input(allocator, key, root_focus); │ │458 } │ │459 │ │460 pub fn clearGrid(self: *Center) void { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │73 │ │74 pub fn init(allocator: std.mem.Allocator, data: *const Self, session: *ui.Session) !View { │ │75 var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .vert });│ │76 - errdefer box.deinit(); │ │76 + errdefer box.deinit(allocator); │ │77 │ │78 // build the header first so we can grab the users-tab focus id and │ │79 // hand it to login/logout │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │80 var users_tab_id: usize = undefined; │ │81 { │ │82 var header_view = try Header.View.init(allocator, &data.header, session); │ │83 - errdefer header_view.deinit(); │ │83 + errdefer header_view.deinit(allocator); │ │84 users_tab_id = header_view.tab_ids[0]; │ │85 try box.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .home_header = header_view }, .rect = null, .min_size = null });│ │86 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯