Changeset 1c6c3e1d in mainline for uspace/lib/ui/src/list.c
- Timestamp:
- 2023-10-22T17:55:33Z (17 months ago)
- Branches:
- ticket/834-toolchain-update
- Children:
- 350ec74
- Parents:
- 315d487 (diff), 133461c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/list.c
r315d487 r1c6c3e1d 738 738 void ui_list_entry_delete(ui_list_entry_t *entry) 739 739 { 740 /* Try to make sure entry does not disappear between cursor and page */ 740 ui_list_t *list = entry->list; 741 742 /* Try to make sure entry does not disappear under cursor or page */ 741 743 if (entry->list->cursor == entry) 742 744 ui_list_cursor_up(entry->list); … … 749 751 750 752 ui_list_entry_destroy(entry); 753 754 /* 755 * But it could still happen if there are not enough entries. 756 * In that case just move page and/or cursor to the first 757 * entry. 758 */ 759 if (list->page == NULL) { 760 list->page = ui_list_first(list); 761 list->page_idx = 0; 762 } else { 763 /* 764 * Entry index might have changed if earlier entry 765 * was deleted. 766 */ 767 list->page_idx = ui_list_entry_get_idx(list->page); 768 } 769 770 if (list->cursor == NULL) { 771 list->cursor = ui_list_first(list); 772 list->cursor_idx = 0; 773 } else { 774 /* 775 * Entry index might have changed if earlier entry 776 * was deleted. 777 */ 778 list->cursor_idx = ui_list_entry_get_idx(list->cursor); 779 } 751 780 } 752 781
Note:
See TracChangeset
for help on using the changeset viewer.