Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree: do not pass custom click to item edited #61434

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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