╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │831 } │ │832 │ │833 pub const View = struct { │ │834 - text_box: wgt.TextBox(ui.Widget), │ │834 + box: wgt.Box(ui.Widget), │ │835 data: *const Header, │ │836 │ │837 pub fn init(allocator: std.mem.Allocator, data: *const Header, session: *ui.Session) !Header.View {│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │838 _ = session; │ │839 + var box = try wgt.Box(ui.Widget).init(allocator, .{ .border_style = null, .direction = .horiz }); │ │840 + errdefer box.deinit(allocator); │ │841 + │ │842 var text_box = try wgt.TextBox(ui.Widget).init(allocator, data.content, .{ .border_style = .hidden, .wrap_kind = .none }); │ │843 errdefer text_box.deinit(allocator); │ │841 - return .{ .text_box = text_box, .data = data }; │ │844 + try box.children.put(allocator, text_box.getFocus().id, .{ .widget = .{ .text_box = text_box }, .rect = null, .min_size = null });│ │845 + │ │846 + return .{ .box = box, .data = data }; │ │847 } │ │848 │ │849 pub fn deinit(self: *Header.View, allocator: std.mem.Allocator) void { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │845 - self.text_box.deinit(allocator); │ │850 + self.box.deinit(allocator); │ │851 } │ │852 │ │853 pub fn build(self: *Header.View, allocator: std.mem.Allocator, constraint: layout.Constraint, root_focus: *Focus) !void {│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │849 - // a single line plus the hidden border is 3 rows tall; stretch the box to │ │850 - // the full width by handing the available width down as a min width. │ │851 - try self.text_box.build(allocator, .{ │ │852 - .min_size = .{ .width = constraint.max_size.width, .height = null }, │ │853 - .max_size = constraint.max_size, │ │854 - }, root_focus); │ │854 + self.clearGrid(); │ │855 + try self.box.build(allocator, constraint, root_focus); │ │856 } │ │857 │ │858 pub fn input(self: *Header.View, allocator: std.mem.Allocator, key: Key, root_focus: *Focus) !void {│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │863 } │ │864 │ │865 pub fn clearGrid(self: *Header.View) void {│ │865 - self.text_box.clearGrid(); │ │866 + self.box.clearGrid(); │ │867 } │ │868 │ │869 pub fn getGrid(self: Header.View) ?Grid { │ ╰────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │869 - return self.text_box.getGrid(); │ │870 + return self.box.getGrid(); │ │871 } │ │872 │ │873 pub fn getFocus(self: *Header.View) *Focus {│ ╰─────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │873 - return self.text_box.getFocus();│ │874 + return self.box.getFocus(); │ │875 } │ │876 }; │ │877 }; │ ╰─────────────────────────────────────────────────╯