refactor: simplify Plane/Widget usage

This commit is contained in:
CJ van den Berg 2025-01-23 16:12:56 +01:00
parent 62cd53c0f3
commit 4145460012
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
15 changed files with 64 additions and 50 deletions

View file

@ -26,10 +26,10 @@ style_factory: ?*const fn (self: *Self, theme: *const Widget.Theme) Widget.Theme
const Self = @This();
pub fn create(allocator: Allocator, parent: Widget, event_source: ?Widget, event_sink: EventHandler) !Widget {
pub fn create(allocator: Allocator, parent: Plane, event_source: ?Widget, event_sink: EventHandler) !Widget {
const self: *Self = try allocator.create(Self);
self.* = .{
.plane = try Plane.init(&(Widget.Box{}).opts(@typeName(Self)), parent.plane.*),
.plane = try Plane.init(&(Widget.Box{}).opts(@typeName(Self)), parent),
.event_sink = event_sink,
};