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

Fix TreeItem shows cell edit in the wrong column when select_mode=Row and TreeItem has multiple columns #89977

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

aqfranco
Copy link
Contributor

@aqfranco aqfranco commented Mar 28, 2024

Fix #88892

Editor would not be brought up when clicking on all but the last column on a TreeItem with SelectMode=Row with multiple columns and all editable, and when the editor was being brought up when clicking on the last column, it was editing the first column.

The reason for that was that the draw_item function was setting the set_meta parameter for that TreeItem for each loop, ignoring if it already had that parameter set, and the select_single_item function was only considering the first column when dealing with a TreeItem with SelectMode=Row.

Fixed draw_item, gui_input, and edit_selected functions by setting set_meta parameter for each column.
Fixed select_single_item function by changing selected_col depending on input.

@aqfranco aqfranco requested a review from a team as a code owner March 28, 2024 12:02
@AThousandShips AThousandShips changed the title Fix #88892: TreeItem shows cell edit in the wrong column when SelectMode=Row and TreeItem has multiple columns Fix TreeItem shows cell edit in the wrong column when select_mode=Row and TreeItem has multiple columns Mar 28, 2024
@AThousandShips AThousandShips added this to the 4.3 milestone Mar 28, 2024
scene/gui/tree.cpp Outdated Show resolved Hide resolved
scene/gui/tree.cpp Outdated Show resolved Hide resolved
scene/gui/tree.cpp Outdated Show resolved Hide resolved
scene/gui/tree.cpp Show resolved Hide resolved
…hen SelectMode=Row and TreeItem has multiple columns

Editor would not be brought up when clicking on all but the last column on a TreeItem with SelectMode=Row with
multiple columns and when the editor was being brought up when clicking on the last column, it was editing the first column

Fixed draw_item, gui_input and edit_selected functions by setting set_meta parameter for each column
Fixed select_single_item function by changing selected_col depending on input
@aqfranco
Copy link
Contributor Author

Thanks for the suggestions, already committed the changes.

@akien-mga akien-mga changed the title Fix TreeItem shows cell edit in the wrong column when select_mode=Row and TreeItem has multiple columns Fix TreeItem shows cell edit in the wrong column when select_mode=Row and TreeItem has multiple columns Apr 4, 2024
@akien-mga akien-mga merged commit b345614 into godotengine:master Apr 4, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeItem shows cell edit in wrong column when SelectMode=Row
4 participants