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)) {
Dictionary drag_data;
drag_data["type"] = "task";
@ -221,7 +221,7 @@ Variant TaskTree::_get_drag_data_fw(const Point2 &p_point, Control *p_from) {
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) {
return false;
}
@ -248,7 +248,7 @@ bool TaskTree::_can_drop_data_fw(const Point2 &p_point, const Variant &p_data, C
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;
TreeItem *item = tree->get_item_at_position(p_point);
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_task_changed();
Variant _get_drag_data_fw(const Point2 &p_point, Control *p_from);
bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void _drop_data_fw(const Point2 &p_point, const Variant &p_data, 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) const;
void _drop_data_fw(const Point2 &p_point, const Variant &p_data);
protected:
static void _bind_methods();