feat: add mouse resizing of panel views
This commit is contained in:
parent
95bf2ac9a7
commit
50d47a73f2
15 changed files with 138 additions and 65 deletions
|
@ -25,19 +25,13 @@ pub const width = 5;
|
|||
|
||||
pub fn create(a: Allocator, parent: Plane) !Widget {
|
||||
const self: *Self = try a.create(Self);
|
||||
self.* = try init(parent);
|
||||
self.* = .{
|
||||
.plane = try Plane.init(&(Widget.Box{}).opts(@typeName(Self)), parent),
|
||||
};
|
||||
try tui.current().input_listeners.add(EventHandler.bind(self, listen));
|
||||
return self.widget();
|
||||
}
|
||||
|
||||
fn init(parent: Plane) !Self {
|
||||
var n = try Plane.init(&(Widget.Box{}).opts(@typeName(Self)), parent);
|
||||
errdefer n.deinit();
|
||||
return .{
|
||||
.plane = n,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn widget(self: *Self) Widget {
|
||||
return Widget.to(self);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue