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

Clicking to the left of a dropdown checkbox will check the checkbox #55774

Closed
jitspoe opened this issue Dec 10, 2021 · 4 comments · Fixed by #91699
Closed

Clicking to the left of a dropdown checkbox will check the checkbox #55774

jitspoe opened this issue Dec 10, 2021 · 4 comments · Fixed by #91699

Comments

@jitspoe
Copy link
Contributor

jitspoe commented Dec 10, 2021

Godot version

3.4

System information

Windows 10

Issue description

Clicking to the left of a checkbox to drop down (ex: selecting resources to export) can check the checkbox. This was particularly frustrating in my case, because I had a large list of levels I wanted to export and just needed to add one, but I clicked well to the left of the checkbox to avoid accidentally checking it, and ended up checking it anyway, meaning I had to completely redo my list of levels to export.

Steps to reproduce

In a project that has subdirectories, Project -> Export, under the resources tab, select "Export selected resources". Click to the left of the dropdown arrow:
image
Note that, instead of opening/closing the dropdown, the checkbox will check.

@timothyqiu
Copy link
Member

Did you mean clicking "left of the dropdown arrow" instead of "left of the checkbox"? Clicking on the dropdown arrow expands/collapses the tree for me.

Clicking on the tree item itself toggles the check. And left of the dropdown arrow is designed to be treated like the item itself I think. But yeah, I think it would be better to only toggle the checkbox when itself is clicked on.

@jitspoe
Copy link
Contributor Author

jitspoe commented Dec 10, 2021

Yeah, I said "Click to the left of the dropdown arrow". In the title I mean that clicking anywhere to the left of the checkbox should NOT check the checkbox. What makes this especially frustrating is the export menu has everything expanded by default, so when you go to collapse a bunch of directories, it's VERY easy to miss the dropdown arrow and check everything. Wasn't really sure if this should have been a suggestion or bug report, but it feels like a user experience bug.

@kleonc
Copy link
Member

kleonc commented Dec 10, 2021

It was done like that in #6553 (see their reasoning in there).

Note that currently Tree has force_edit_checkbox_only_on_checkbox flag which is not exposed to scripting:

godot/scene/gui/tree.cpp

Lines 4730 to 4736 in 85380c5

void Tree::set_edit_checkbox_cell_only_when_checkbox_is_pressed(bool p_enable) {
force_edit_checkbox_only_on_checkbox = p_enable;
}
bool Tree::get_edit_checkbox_cell_only_when_checkbox_is_pressed() const {
return force_edit_checkbox_only_on_checkbox;
}

However, it doesn't really make what its name says as force_edit_checkbox_only_on_checkbox == true only disallows toggling the checkbox by clicking to the right from it (you can still toggle by clicking to the left/above/below):

godot/scene/gui/tree.cpp

Lines 2507 to 2518 in 85380c5

case TreeItem::CELL_MODE_CHECK: {
bring_up_editor = false; //checkboxes are not edited with editor
if (force_edit_checkbox_only_on_checkbox) {
if (x < cache.checked->get_width()) {
p_item->set_checked(col, !c.checked);
item_edited(col, p_item);
}
} else {
p_item->set_checked(col, !c.checked);
item_edited(col, p_item);
}
click_handled = true;

It's used for example by EditorFeatureProfileManager:

class_list->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true);

So in there you can't toggle checkbox by clicking to the right of the checkbox but you can still toggle it by clicking to the left (however currently an invisible collapse/folding arrow can consume mouse event, this should be fixed by #55791):
E9kH1Tq9WE

So some things to discuss/consider:

  • Should the behavior for in tree checkboxes be customizable?
  • If so, how should it be customizable?
  • Should it be exposed to scripting?
  • What should be the dafault behavior?
  • What should be the behavior for some in editor trees (like the ones in Export or Manage Editor Features dialogs)?

@jitspoe
Copy link
Contributor Author

jitspoe commented Dec 14, 2021

Don't know that it needs to be customizable, but I feel like having the current behavior where something visibly to the right of the dropdown can be triggered by clicking to the left of the dropdown feels broken.

Bad:
[check][dropdown][check]

OK:
[nothing][dropdown][check]
[dropdown][dropdown][check]

So if either the dropdown consumes the click of everything to the left of the checkbox OR the checkbox click area only includes the checkbox and the area to the right of it when in a tree, I feel that would adequately solve this issue.

If anybody is wondering, this was my frustrated reaction when it happened: https://clips.twitch.tv/AnimatedEndearingCarrotShadyLulu-JjxECm96YRNYVZOw 😅
I just needed to add 1 level.

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

Successfully merging a pull request may close this issue.

4 participants