Fix drag&drop broken
This commit is contained in:
parent
5baddc2f3e
commit
ec2fd2b143
|
@ -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")) {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue