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