Skip to content

Commit

Permalink
tree: always emit item_edited
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Franke committed May 26, 2022
1 parent 08e540a commit 2d14164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3971,16 +3971,15 @@ TreeItem *Tree::get_last_item() const {
return last;
}

void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_mouse_index) {
void Tree::item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index) {
edited_item = p_item;
edited_col = p_column;
if (p_item != nullptr && p_column >= 0 && p_column < p_item->cells.size()) {
edited_item->cells.write[p_column].dirty = true;
}
if (p_mouse_index == MouseButton::NONE) {
emit_signal(SNAME("item_edited"));
} else {
emit_signal(SNAME("custom_item_clicked"), p_mouse_index);
emit_signal(SNAME("item_edited"));
if (p_custom_mouse_index != MouseButton::NONE) {
emit_signal(SNAME("custom_item_clicked"), p_custom_mouse_index);
}
}

Expand Down
2 changes: 1 addition & 1 deletion scene/gui/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class Tree : public Control {

void _notification(int p_what);

void item_edited(int p_column, TreeItem *p_item, MouseButton p_mouse_index = MouseButton::NONE);
void item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index = MouseButton::NONE);
void item_changed(int p_column, TreeItem *p_item);
void item_selected(int p_column, TreeItem *p_item);
void item_deselected(int p_column, TreeItem *p_item);
Expand Down

0 comments on commit 2d14164

Please sign in to comment.