feat(tabs): start work on a tabbar widget

This commit is contained in:
CJ van den Berg 2025-01-23 22:32:08 +01:00
parent 1d947ab499
commit d7b48b40f1
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
7 changed files with 196 additions and 2 deletions

View file

@ -97,6 +97,12 @@ pub fn remove(self: *Self, w: Widget) void {
self.widgets.orderedRemove(i).widget.deinit(self.allocator);
}
pub fn remove_all(self: *Self) void {
for (self.widgets.items) |*w|
w.widget.deinit(self.allocator);
self.widgets.clearRetainingCapacity();
}
pub fn empty(self: *const Self) bool {
return self.widgets.items.len == 0;
}