Fix drag&drop broken

This commit is contained in:
Serhii Snitsaruk 2023-04-06 23:54:56 +02:00
parent 5baddc2f3e
commit ec2fd2b143
2 changed files with 6 additions and 6 deletions

View File

@ -210,7 +210,7 @@ void TaskTree::deselect() {
} }
} }
Variant TaskTree::_get_drag_data_fw(const Point2 &p_point, Control *p_from) { Variant TaskTree::_get_drag_data_fw(const Point2 &p_point) {
if (editable && tree->get_item_at_position(p_point)) { if (editable && tree->get_item_at_position(p_point)) {
Dictionary drag_data; Dictionary drag_data;
drag_data["type"] = "task"; drag_data["type"] = "task";
@ -221,7 +221,7 @@ Variant TaskTree::_get_drag_data_fw(const Point2 &p_point, Control *p_from) {
return Variant(); return Variant();
} }
bool TaskTree::_can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { bool TaskTree::_can_drop_data_fw(const Point2 &p_point, const Variant &p_data) const {
if (!editable) { if (!editable) {
return false; return false;
} }
@ -248,7 +248,7 @@ bool TaskTree::_can_drop_data_fw(const Point2 &p_point, const Variant &p_data, C
return false; return false;
} }
void TaskTree::_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { void TaskTree::_drop_data_fw(const Point2 &p_point, const Variant &p_data) {
Dictionary d = p_data; Dictionary d = p_data;
TreeItem *item = tree->get_item_at_position(p_point); TreeItem *item = tree->get_item_at_position(p_point);
if (item && d.has("task")) { if (item && d.has("task")) {

View File

@ -41,9 +41,9 @@ private:
void _on_item_mouse_selected(const Vector2 &p_pos, int p_button_index); void _on_item_mouse_selected(const Vector2 &p_pos, int p_button_index);
void _on_task_changed(); void _on_task_changed();
Variant _get_drag_data_fw(const Point2 &p_point, Control *p_from); Variant _get_drag_data_fw(const Point2 &p_point);
bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data) const;
void _drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); void _drop_data_fw(const Point2 &p_point, const Variant &p_data);
protected: protected:
static void _bind_methods(); static void _bind_methods();