From 950c5af01d105bbb9caebd5c4e81b9365c503c00 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Thu, 11 Dec 2025 19:00:02 +0100 Subject: [PATCH] refactor: add panel border to inputview --- src/tui/inputview.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tui/inputview.zig b/src/tui/inputview.zig index 80578c4..d6d87c5 100644 --- a/src/tui/inputview.zig +++ b/src/tui/inputview.zig @@ -13,6 +13,7 @@ const input = @import("input"); const tui = @import("tui.zig"); const Widget = @import("Widget.zig"); +const WidgetList = @import("WidgetList.zig"); pub const name = "inputview"; @@ -23,6 +24,7 @@ last_count: u64 = 0, buffer: Buffer, const Self = @This(); +const widget_type: Widget.Type = .panel; const Entry = struct { time: i64, @@ -34,6 +36,7 @@ const Buffer = ArrayList(Entry); pub fn create(allocator: Allocator, parent: Plane) !Widget { var n = try Plane.init(&(Widget.Box{}).opts_vscroll(@typeName(Self)), parent); errdefer n.deinit(); + const container = try WidgetList.createHStyled(allocator, parent, "panel_frame", .dynamic, widget_type); const self = try allocator.create(Self); errdefer allocator.destroy(self); self.* = .{ @@ -43,7 +46,9 @@ pub fn create(allocator: Allocator, parent: Plane) !Widget { .buffer = .empty, }; try tui.input_listeners().add(EventHandler.bind(self, listen)); - return Widget.to(self); + container.ctx = self; + try container.add(Widget.to(self)); + return container.widget(); } pub fn deinit(self: *Self, allocator: Allocator) void {