refactor: add focus/unfocus to widget vtable

This commit is contained in:
CJ van den Berg 2025-11-06 18:16:16 +01:00
parent 70cc191c4a
commit 3437f4fd20
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 42 additions and 0 deletions

View file

@ -100,3 +100,11 @@ pub fn walk(self: *Self, walk_ctx: *anyopaque, f: Widget.WalkFn) bool {
}
return false;
}
pub fn focus(self: *Self) void {
for (self.widgets.items) |*w| w.widget.focus();
}
pub fn unfocus(self: *Self) void {
for (self.widgets.items) |*w| w.widget.unfocus();
}