╭ changed ──────╮ │src/ui/Home.zig│ ╰───────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │87 │ │88 { │ │89 var stack = wgt.Stack(ui.Widget).init(allocator); │ │90 - errdefer stack.deinit(); │ │90 + errdefer stack.deinit(allocator); │ │91 │ │92 { │ │93 var users_view = try Users.View.init(allocator, &data.users);│ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │94 - errdefer users_view.deinit(); │ │95 - try stack.children.put(stack.allocator, users_view.getFocus().id, .{ .home_users = users_view });│ │94 + errdefer users_view.deinit(allocator); │ │95 + try stack.children.put(allocator, users_view.getFocus().id, .{ .home_users = users_view }); │ │96 } │ │97 │ │98 { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 99 var repos_view = try Repos.View.init(allocator, &data.repos); │ │100 - errdefer repos_view.deinit(); │ │101 - try stack.children.put(stack.allocator, repos_view.getFocus().id, .{ .home_repos = repos_view });│ │100 + errdefer repos_view.deinit(allocator); │ │101 + try stack.children.put(allocator, repos_view.getFocus().id, .{ .home_repos = repos_view }); │ │102 } │ │103 │ │104 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │105 var auth_view = try Auth.View.init(allocator, &data.auth, session, users_tab_id); │ │106 - errdefer auth_view.deinit(); │ │107 - try stack.children.put(stack.allocator, auth_view.getFocus().id, .{ .home_auth = auth_view }); │ │106 + errdefer auth_view.deinit(allocator); │ │107 + try stack.children.put(allocator, auth_view.getFocus().id, .{ .home_auth = auth_view }); │ │108 } │ │109 │ │110 try box.children.put(allocator, stack.getFocus().id, .{ .widget = .{ .stack = stack }, .rect = null, .min_size = null });│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │119 return self; │ │120 } │ │121 │ │122 - pub fn deinit(self: *View) void { │ │123 - self.box.deinit(); │ │122 + pub fn deinit(self: *View, allocator: std.mem.Allocator) void { │ │123 + self.box.deinit(allocator); │ │124 } │ │125 │ │126 - pub fn build(self: *View, constraint: layout.Constraint, root_focus: *Focus) !void { │ │126 + pub fn build(self: *View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ │127 self.clearGrid(); │ │128 const header = &self.box.children.values()[header_index].widget.home_header; │ │129 const stack = &self.box.children.values()[stack_index].widget.stack; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 if (header.getSelectedIndex()) |index| { │ │133 stack.getFocus().child_id = stack.children.keys()[index]; │ │134 } │ │135 - try self.box.build(constraint, root_focus); │ │135 + try self.box.build(allocator, constraint, root_focus); │ │136 } │ │137 │ │138 - pub fn input(self: *View, key: inp.Key, root_focus: *Focus) !void { │ │138 + pub fn input(self: *View, allocator: std.mem.Allocator, key: inp.Key, root_focus: *Focus) !void {│ │139 if (self.getFocus().child_id) |child_id| { │ │140 if (self.box.children.getIndex(child_id)) |current_index| { │ │141 const child = &self.box.children.values()[current_index].widget; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────╮ │156 .up => { │ │157 switch (child.*) { │ │158 .home_header => { │ │159 - try child.input(key, root_focus); │ │159 + try child.input(allocator, key, root_focus); │ │160 }, │ │161 .stack => { │ │162 if (child.stack.getSelected()) |selected_widget| {│ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │169 if (at_top) { │ │170 index = header_index; │ │171 } else { │ │172 - try child.input(key, root_focus); │ │172 + try child.input(allocator, key, root_focus);│ │173 } │ │174 } │ │175 }, │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯