Skip to content

Implement Selectable GUI component#2016

Open
bagggage wants to merge 1 commit into
PixelGuys:masterfrom
bagggage:gui-selectable
Open

Implement Selectable GUI component#2016
bagggage wants to merge 1 commit into
PixelGuys:masterfrom
bagggage:gui-selectable

Conversation

@bagggage

Copy link
Copy Markdown
Contributor

This PR adds a simple GUI component that can be selected, it also has one child element, thus making anything selectable. The component allows setting the corresponding callback in the code, and also has the ability to force it to be selected and deselected by calling the .select() and .deselect() methods respectively. The component has corresponding visual effects.

An example of a simple list based on Selectable:

Hovered:
image_2025-10-15_16-48-26

Selected:
image_2025-10-15_16-48-56

@IntegratedQuantum

Copy link
Copy Markdown
Member

I wonder if it would be better to implement this as a list of selectables insead of as single elements.
This would allow for arrow key navigation.

@bagggage

Copy link
Copy Markdown
Contributor Author

Well, I will probably try to implement the SelectableList based on the VerticalList, but the Selectable as a separate component i think could be useful as well.

@IntegratedQuantum

Copy link
Copy Markdown
Member

I'm not sure, I don't see where we'd still need those.

@Wunka

Wunka commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

The SelectableList could then also be used for the dropdown menu or not?

@IntegratedQuantum

Copy link
Copy Markdown
Member

yes

@BoySanic BoySanic moved this to WIP/not ready for review in PRs to review Nov 3, 2025
@IntegratedQuantum IntegratedQuantum moved this from WIP/not ready for review to In review in PRs to review Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

4 participants