╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │818 } │ │819 │ │820 pub fn deinit(self: *FlowBox, allocator: std.mem.Allocator) void {│ │809 - self.focus.deinit(allocator); │ │821 + self.focus.destroy(allocator); │ │822 if (self.grid) |*grid| { │ │823 grid.deinit(); │ │824 self.grid = null; │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │930 } │ │931 │ │932 pub fn getFocus(self: *FlowBox) *Focus { │ │921 - return &self.focus; │ │933 + return self.focus; │ │934 } │ │935 │ │936 pub fn cellRect(self: FlowBox, index: usize) ?layout.IRect {│ ╰─────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │956 scroll: wgt.Scroll(Widget), │ │957 │ │958 pub fn init(allocator: std.mem.Allocator, options: FlowBox.Options) !Scroll { │ │947 - var layout_inner = FlowBox.init(allocator, options); │ │959 + var layout_inner = try FlowBox.init(allocator, options); │ │960 errdefer layout_inner.deinit(allocator); │ │949 - var scroll = try wgt.Scroll(Widget).init(allocator, .{ .flow_box = layout_inner }, .vert); │ │961 + var scroll = try wgt.Scroll(Widget).init(allocator, .{ .flow_box = layout_inner }, .{ .direction = .vert });│ │962 errdefer scroll.deinit(allocator); │ │963 return .{ .scroll = scroll }; │ │964 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │1062 // used inside Box(horiz) with a min_size so the box reserves space for the│ │1063 // children that follow, pushing them to the right. │ │1064 pub const Spacer = struct { │ │1053 - focus: Focus, │ │1065 + focus: *Focus, │ │1066 grid: ?Grid, │ │1067 │ │1056 - pub fn init() Spacer { │ │1068 + pub fn init(allocator: std.mem.Allocator) !Spacer { │ │1069 return .{ │ │1058 - .focus = Focus.init(.container), │ │1070 + .focus = try Focus.create(allocator, .container), │ │1071 .grid = null, │ │1072 }; │ │1073 } │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │1074 │ │1075 pub fn deinit(self: *Spacer, allocator: std.mem.Allocator) void {│ │1064 - self.focus.deinit(allocator); │ │1076 + self.focus.destroy(allocator); │ │1077 if (self.grid) |*grid| { │ │1078 grid.deinit(); │ │1079 self.grid = null; │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │1107 } │ │1108 │ │1109 pub fn getFocus(self: *Spacer) *Focus {│ │1098 - return &self.focus; │ │1110 + return self.focus; │ │1111 } │ │1112 }; │ │1113 │ ╰─────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │1114 // a single-child wrapper that builds the child at its natural size and│ │1115 // positions its grid in the middle of the area granted by the parent │ │1116 pub const Center = struct { │ │1105 - focus: Focus, │ │1117 + focus: *Focus, │ │1118 grid: ?Grid, │ │1119 child: *Widget, │ │1120 direction: Direction, │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────╮ │1126 errdefer allocator.destroy(child); │ │1127 child.* = child_widget; │ │1128 return .{ │ │1117 - .focus = Focus.init(.container), │ │1129 + .focus = try Focus.create(allocator, .container),│ │1130 .grid = null, │ │1131 .child = child, │ │1132 .direction = direction, │ ╰───────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │1134 } │ │1135 │ │1136 pub fn deinit(self: *Center, allocator: std.mem.Allocator) void {│ │1125 - self.focus.deinit(allocator); │ │1137 + self.focus.destroy(allocator); │ │1138 if (self.grid) |*grid| { │ │1139 grid.deinit(); │ │1140 self.grid = null; │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │1199 } │ │1200 │ │1201 pub fn getFocus(self: *Center) *Focus {│ │1190 - return &self.focus; │ │1202 + return self.focus; │ │1203 } │ │1204 }; │ │1205 │ ╰─────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯