feat: add mouse resizing of panel views

This commit is contained in:
CJ van den Berg 2024-08-13 19:38:35 +02:00
parent 95bf2ac9a7
commit 50d47a73f2
15 changed files with 138 additions and 65 deletions

View file

@ -34,7 +34,7 @@ file: bool = false,
const project_icon = "";
const Self = @This();
pub fn create(a: Allocator, parent: Plane) !Widget {
pub fn create(a: Allocator, parent: Plane, event_handler: ?Widget.EventHandler) !Widget {
const btn = try Button.create(Self, a, parent, .{
.ctx = .{
.a = a,
@ -52,6 +52,7 @@ pub fn create(a: Allocator, parent: Plane) !Widget {
.on_layout = layout,
.on_render = render,
.on_receive = receive,
.on_event = event_handler,
});
return Widget.to(btn);
}