RobLoach / RobLoach/nuklear_console
list_view: add optional multi-select mode
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22
- Forks
- 4
- Avg merge
- 4m
- Merged PRs (30d)
- 2
Description
list_view supports a single selected index (nk_console_list_view_set_selected, #254). There is no way to select multiple items, which limits use cases like bulk file ops or settings that apply to a subset of a list.
Suggested Implementation
- Add
nk_console_list_view_set_multi_select(widget, nk_bool enabled). - When enabled, maintain a
nk_bool*selected mask alongside the existingselectedint. - Pressing A toggles the focused item in the mask; existing single-select behavior unchanged.
- Add
nk_console_list_view_is_selected(widget, int index)accessor.
QA
Multi-select enabled: pressing A on items 0, 2, 4 marks all three. Single-select still returns one index via the existing getter.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from nk_console_list_view_set_selected and the list_view input handling, then trace how the existing selected index is stored and changed when A is pressed. Add the multi-select toggle and nk_console_list_view_is_selected accessor described in the issue. Done means items 0, 2, and 4 remain selected after toggling, while single-select still exposes one index through the existing getter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100