listitemmanager: Fix section change handler mistake
The statement is not doing what it was meant to do. gtk_list_item_manager_get_nth (self, position, &offset) returns the tile for a given position, and if the tile maps to more than 1 item, the offset indicates how far into that tile the given position is. So position - offset would give us the position of this tile. It doesn't make sense to subtract it from n_items. Instead, we should be adding the offset to compensate for having landed too early in the list, such that we successfully reach position + n_items.
This commit is contained in:
@@ -1625,7 +1625,7 @@ gtk_list_item_manager_model_sections_changed_cb (GListModel *model,
|
||||
gtk_list_item_change_clear_header (&change, &header->widget);
|
||||
gtk_list_tile_set_type (header, GTK_LIST_TILE_UNMATCHED_HEADER);
|
||||
|
||||
n_items -= MIN (n_items, position - offset);
|
||||
n_items += offset;
|
||||
while (n_items > 0)
|
||||
{
|
||||
switch (tile->type)
|
||||
|
||||
Reference in New Issue
Block a user