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

ItemList: Clarify distinction between disabled and selected in sending signals #74250

Conversation

daBlesr
Copy link
Contributor

@daBlesr daBlesr commented Mar 2, 2023

I have made sure there is a clear distinction in which situations signals are triggered:

when item is disabled: send no signal at all for this item (activated, selected, deselected, ...)
when item is selectable: send signals (item_selected, multi_selected) when not disabled.

when is activated now triggered? When item is not disabled and double clicked (pressing enter is only possible when selectable 😄 )

I am in conflict with deselecting however, I am allowing deselection even when selectable is turned off to keep this behaviour as before.

Fixes: #74086

@daBlesr daBlesr requested a review from a team as a code owner March 2, 2023 19:50
@daBlesr
Copy link
Contributor Author

daBlesr commented Mar 4, 2023

Hi @KoBeWi could I request a review from you, or @akien-mga could you add anyone as a reviewer whom you might think would be able to review this PR?

@Chaosus Chaosus added this to the 4.1 milestone Mar 6, 2023
scene/gui/item_list.cpp Outdated Show resolved Hide resolved
scene/gui/item_list.cpp Outdated Show resolved Hide resolved
scene/gui/item_list.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga changed the title made clear distinction between disabled and selected in sending signals. Make clear distinction between disabled and selected in sending signals Jun 19, 2023
@akien-mga akien-mga requested a review from KoBeWi June 19, 2023 19:42
@akien-mga akien-mga modified the milestones: 4.1, 4.2 Jun 19, 2023
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On technical side it looks good.

…g signals

disabled -> not sending any signal at all (activated, selected, deselected, ...)
selected -> only possible when not disabled, and when selectable

Fixes godotengine#74086.
@akien-mga akien-mga changed the title Make clear distinction between disabled and selected in sending signals ItemList: Clarify distinction between disabled and selected in sending signals Aug 17, 2023
@akien-mga akien-mga force-pushed the bugfix-selection-signals-when-disabled-or-not-selectable branch from 7732bf6 to fa63107 Compare August 17, 2023 08:35
@akien-mga
Copy link
Member

OP was no longer responsive, so I went ahead and fixed the style issues myself.

@akien-mga akien-mga merged commit ef77ae7 into godotengine:master Aug 17, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

ItemList: Disabled items still trigger selection and activation signals on mouse
6 participants