mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 17:23:09 +03:00
Slight refactor of drag end handling, for future handling of more types of drag.
This commit is contained in:
parent
2dc8b64153
commit
5f4c624c5b
@ -1989,15 +1989,24 @@ void treeview_mouse_action(treeview *tree,
|
||||
assert(tree != NULL);
|
||||
assert(tree->root != NULL);
|
||||
|
||||
/* Handle selection drag end */
|
||||
if (mouse == BROWSER_MOUSE_HOVER &&
|
||||
tree->drag.type == TV_DRAG_SELECTION) {
|
||||
treeview_commit_selection_drag(tree);
|
||||
tree->drag.type = TV_DRAG_NONE;
|
||||
tree->drag.start_node = NULL;
|
||||
/* Handle drag ends */
|
||||
if (mouse == BROWSER_MOUSE_HOVER) {
|
||||
switch (tree->drag.type) {
|
||||
case TV_DRAG_SELECTION:
|
||||
treeview_commit_selection_drag(tree);
|
||||
tree->drag.type = TV_DRAG_NONE;
|
||||
tree->drag.start_node = NULL;
|
||||
|
||||
tree->cw_t->drag_status(tree->cw_h, CORE_WINDOW_DRAG_NONE);
|
||||
return;
|
||||
tree->cw_t->drag_status(tree->cw_h,
|
||||
CORE_WINDOW_DRAG_NONE);
|
||||
return;
|
||||
case TV_DRAG_MOVE:
|
||||
/* TODO */
|
||||
break;
|
||||
default:
|
||||
/* No drag to end */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (y > tree->root->height) {
|
||||
|
Loading…
Reference in New Issue
Block a user