gtk: implement drag-to-move for splits

One major todo is moving splits across different split trees (i.e.
moving across tabs and windows), but that would involve a lot more logic.
This MVP version works for now.

GTK version of #10090

Closes #10224
This commit is contained in:
Leah Amelia Chen
2026-01-22 01:39:53 +08:00
parent 9e30f70f23
commit 1d053bd6ea
6 changed files with 381 additions and 12 deletions

View File

@@ -183,6 +183,18 @@ pub fn SplitTree(comptime V: type) type {
};
}
/// Find the handle within this tree that corresponds
/// to the given view. Uses pointer equality.
pub fn locate(self: *const Self, view: *const View) ?Node.Handle {
var it = self.iterator();
while (it.next()) |entry| {
if (entry.view == view) {
return entry.handle;
}
}
return null;
}
/// An iterator over all the views in the tree.
pub fn iterator(
self: *const Self,