tree: implement workspace dragging
This commit is contained in:
parent
132986df2a
commit
1dd20fb87b
8 changed files with 235 additions and 7 deletions
|
|
@ -9,7 +9,8 @@ use {
|
|||
state::State,
|
||||
tree::{
|
||||
walker::NodeVisitor, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||
OutputNode, StackedNode, TileDragDestination,
|
||||
OutputNode, StackedNode, TileDragDestination, WorkspaceDragDestination,
|
||||
WorkspaceNodeId,
|
||||
},
|
||||
utils::{copyhashmap::CopyHashMap, linkedlist::LinkedList},
|
||||
},
|
||||
|
|
@ -98,6 +99,21 @@ impl DisplayNode {
|
|||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn workspace_drag_destination(
|
||||
&self,
|
||||
source: WorkspaceNodeId,
|
||||
x: i32,
|
||||
y: i32,
|
||||
) -> Option<WorkspaceDragDestination> {
|
||||
for output in self.outputs.lock().values() {
|
||||
let pos = output.node_absolute_position();
|
||||
if pos.contains(x, y) {
|
||||
return output.workspace_drag_destination(source, x, y);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl Node for DisplayNode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue