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

Add Toggle selection mode to ItemList #99355

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

havi05
Copy link
Contributor

@havi05 havi05 commented Nov 17, 2024

I have added a Toggle selection to the ItemList node. Now you can select an item and deselect it by clicking on it again.
Closes godotengine/godot-proposals#6371

It emits the signal multi_selected when a value changes. I think it would be clearer if it would be renamed to selection_changed, for example, but that would be a breaking change. Of course it would be possible to add a new signal, but that would duplicate the functionality.

What do you think?
Should I just change the description of multi_selected to add the toggle mode?

@havi05 havi05 requested review from a team as code owners November 17, 2024 13:48
@havi05 havi05 force-pushed the itemlist-toggle-mode branch from 753f283 to ce88fc5 Compare November 17, 2024 13:58
@Chaosus Chaosus added this to the 4.4 milestone Nov 17, 2024
@havi05 havi05 force-pushed the itemlist-toggle-mode branch from ce88fc5 to 5e3455c Compare November 17, 2024 15:11
@AThousandShips AThousandShips modified the milestones: 4.4, 4.x Nov 17, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Dec 12, 2024

I think the multi_selected signal is fine, even the description does not need altering.
selection_changed has no way to provide the selected index, so it would be less convenient.

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.

I've seen lists like that in other apps, so supporting it makes sense. The implementation looks ok, it's very simple.

@havi05 havi05 force-pushed the itemlist-toggle-mode branch from 5e3455c to b29e93b Compare December 12, 2024 16:33
@havi05
Copy link
Contributor Author

havi05 commented Dec 12, 2024

Applied the requested changes.

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Dec 14, 2024
@akien-mga akien-mga merged commit ffe0cde into godotengine:master Dec 14, 2024
20 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.

Add a toggle select mode to ItemList
5 participants