From 15fd33807410c2b91a61b40793d681b536a4476c Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 11 Dec 2025 18:59:32 +0100 Subject: [PATCH] refactor: add panel border to info_view --- src/tui/info_view.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tui/info_view.zig b/src/tui/info_view.zig index 86c65e2..7dee8b2 100644 --- a/src/tui/info_view.zig +++ b/src/tui/info_view.zig @@ -2,6 +2,7 @@ const std = @import("std"); const Allocator = @import("std").mem.Allocator; const Plane = @import("renderer").Plane; const Widget = @import("Widget.zig"); +const WidgetList = @import("WidgetList.zig"); pub const name = @typeName(Self); @@ -13,15 +14,20 @@ plane: Plane, view_rows: usize = 0, lines: std.ArrayList([]const u8), +const widget_type: Widget.Type = .panel; + pub fn create(allocator: Allocator, parent: Plane) !Widget { const self = try allocator.create(Self); errdefer allocator.destroy(self); + const container = try WidgetList.createHStyled(allocator, parent, "panel_frame", .dynamic, widget_type); self.* = .{ .allocator = allocator, .plane = try Plane.init(&(Widget.Box{}).opts(name), parent), .lines = .empty, }; - return Widget.to(self); + container.ctx = self; + try container.add(Widget.to(self)); + return container.widget(); } pub fn deinit(self: *Self, allocator: Allocator) void {