-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fixed "Open" button being enabled when nothing is selected in a FileDialog while in "Open folder" mode #16710
Fixed "Open" button being enabled when nothing is selected in a FileDialog while in "Open folder" mode #16710
Conversation
scene/gui/file_dialog.cpp
Outdated
@@ -756,7 +754,7 @@ void FileDialog::_bind_methods() { | |||
ClassDB::bind_method(D_METHOD("_unhandled_input"), &FileDialog::_unhandled_input); | |||
|
|||
ClassDB::bind_method(D_METHOD("_tree_selected"), &FileDialog::_tree_selected); | |||
ClassDB::bind_method(D_METHOD("_tree_db_selected"), &FileDialog::_tree_dc_selected); | |||
ClassDB::bind_method(D_METHOD("_tree_dc_selected"), &FileDialog::_tree_dc_selected); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any clue about what dc
means in this method? Maybe it should be made more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"double click", it's tied to the Tree's "item_activated" signal. Should it be renamed "_tree_double_clicked"?
Or better yet, "_tree_item_activated", to represent which signal it's tied with (See #16839).
…ialog while in "Open folder" mode.
934e702
to
db80d56
Compare
I renamed the |
@@ -756,7 +754,7 @@ void FileDialog::_bind_methods() { | |||
ClassDB::bind_method(D_METHOD("_unhandled_input"), &FileDialog::_unhandled_input); | |||
|
|||
ClassDB::bind_method(D_METHOD("_tree_selected"), &FileDialog::_tree_selected); | |||
ClassDB::bind_method(D_METHOD("_tree_db_selected"), &FileDialog::_tree_dc_selected); | |||
ClassDB::bind_method(D_METHOD("_tree_item_activated"), &FileDialog::_tree_item_activated); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually my bad, the original name needs to be kept for the binding to avoid breaking compatibility (but the C++ name can still be changed). Will add this one to #16863.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that it starts with an underscore, I think this is not a problem.
This won't be listed in documentation or autocompleted in GDScript. If anyone uses underscore-starting methods, they should be prepared to fix their messy hacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. :)
Also changed the
_tree_dc_selected
binding to match the function's name.