Skip to content

list_view: optional search/filter input#187

Merged
RobLoach merged 4 commits into
masterfrom
fix/list-view-search-filter
Jun 14, 2026
Merged

list_view: optional search/filter input#187
RobLoach merged 4 commits into
masterfrom
fix/list-view-search-filter

Conversation

@RobLoach

Copy link
Copy Markdown
Owner

Adds nk_console_list_view_set_searchable() which inserts a textedit sibling immediately before the list view. When the filter is non-empty, only items whose labels case-insensitively contain the search text are shown, while nk_console_list_view_selected() always returns a real (unfiltered) index. The demo's 200-item list view enables the search box.

Fixes #186

@RobLoach RobLoach assigned RobLoach and unassigned RobLoach May 18, 2026
@RobLoach RobLoach marked this pull request as draft May 30, 2026 17:31
nk_console_list_view_get_label get_label_callback; /** The callback used to retrieve the labels for each item. */
nk_bool searchable; /** When true, a sibling search field filters visible items. */
char search_buffer[NK_CONSOLE_LIST_VIEW_SEARCH_BUFFER_SIZE]; /** Search filter text. */
struct nk_console* search; /** The sibling search textedit widget, if one was added. */

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fix warnings when compiling the tests.

@RobLoach RobLoach self-assigned this Jun 14, 2026
@RobLoach RobLoach marked this pull request as ready for review June 14, 2026 15:48
@RobLoach RobLoach merged commit f2d0d98 into master Jun 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_view: optional search/filter input

1 participant