cursor: allow commands to override cursor operations
Now that we properly handle state changes during cursor operations, blocking these commands if the target view is the target of a cursor operation is unnecessary complexity. It is also inconsistent as we don't block changing the tags of the view.
This commit is contained in:
@ -179,17 +179,13 @@ pub fn setTheme(self: *Self, theme: ?[*:0]const u8, _size: ?u32) !void {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn isCursorActionTarget(self: Self, view: *const View) bool {
|
||||
return switch (self.mode) {
|
||||
pub fn handleViewUnmap(self: *Self, view: *View) void {
|
||||
if (switch (self.mode) {
|
||||
.passthrough => false,
|
||||
.down => |target_view| target_view == view,
|
||||
.move => |target_view| target_view == view,
|
||||
.resize => |data| data.view == view,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn handleViewUnmap(self: *Self, view: *View) void {
|
||||
if (self.isCursorActionTarget(view)) {
|
||||
}) {
|
||||
self.mode = .passthrough;
|
||||
self.clearFocus();
|
||||
}
|
||||
|
Reference in New Issue
Block a user