add sample image; list view bugfix

This commit is contained in:
nakst 2021-10-09 09:49:40 +01:00
parent 5924981243
commit f3bb3c07e3
3 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@
// TODO Drag and drop.
// TODO GetFirstIndex/GetLastIndex assume that every group is non-empty.
// TODO Sticking to top/bottom scroll when inserting/removing space.
// TODO Audit usage of MeasureItems -- it doesn't take into account the gap between items!
struct ListViewItemElement : EsElement {
uintptr_t index; // Index into the visible items array.
@ -1965,6 +1966,7 @@ void EsListViewChangeStyles(EsListView *view, const EsStyle *style, const EsStyl
if (!view->groups[i].itemCount) continue;
spaceDelta -= view->groups[i].totalSize;
view->groups[i].totalSize = view->MeasureItems(i, 0, view->groups[i].itemCount);
view->groups[i].totalSize += view->style->gapMinor * (view->groups[i].itemCount - 1);
spaceDelta += view->groups[i].totalSize;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

View File

@ -43,3 +43,9 @@ https://unsplash.com/photos/SUwDcVdUGiY
Author Patrick Boucher
This file is licened under the Unsplash License.
https://unsplash.com/license
Abstract.jpg
https://unsplash.com/photos/E8Ufcyxz514
Author Fakurian Design
This file is licened under the Unsplash License.
https://unsplash.com/license