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) {
|
||||
/* 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);
|
||||
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