Sat, 30 Aug 2025 10:18:09 +0200
extend ui_list_setselection to allow to remove selections
| ui/common/types.c | file | annotate | diff | comparison | revisions |
--- a/ui/common/types.c Sat Aug 30 10:14:46 2025 +0200 +++ b/ui/common/types.c Sat Aug 30 10:18:09 2025 +0200 @@ -627,10 +627,12 @@ } UIEXPORT void ui_list_setselection(UiList *list, int index) { - if (list->setselection && index >= 0) { - UiListSelection sel; - sel.count = 1; - sel.rows = &index; + if (list->setselection) { + UiListSelection sel = { 0, NULL }; + if(index >= 0) { + sel.count = 1; + sel.rows = &index; + } list->setselection(list, sel); } }