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

@ -119,7 +119,6 @@ fn init(a: Allocator) !*Self {
self.rdr.dispatch_mouse_drag = dispatch_mouse_drag;
self.rdr.dispatch_event = dispatch_event;
try self.rdr.run();
const n = self.rdr.stdplane();
try frame_clock.start();
try self.commands.init(self);
@ -132,7 +131,7 @@ fn init(a: Allocator) !*Self {
try self.listen_sigwinch();
},
}
self.mainview = try mainview.create(a, n);
self.mainview = try mainview.create(a);
self.resize();
self.rdr.set_terminal_style(self.theme.editor);
try self.rdr.render();
@ -701,6 +700,10 @@ pub fn resize(self: *Self) void {
need_render();
}
pub fn stdplane(self: *Self) renderer.Plane {
return self.rdr.stdplane();
}
pub fn screen(self: *Self) Widget.Box {
return Widget.Box.from(self.rdr.stdplane());
}