summaryrefslogtreecommitdiff
path: root/src/ui/listwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 13:40:54 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 13:41:35 +0300
commitf9117532955f0d8935971eb1053f13f9ecab7662 (patch)
tree843914f355dc8da3cadaa6bd450075c7dc501054 /src/ui/listwidget.c
parent6074a467110bfb4e40c3e659cc674d7bbaa82d5a (diff)
Preferences: Collapse preformatted blocks on page load
IssueID #180
Diffstat (limited to 'src/ui/listwidget.c')
-rw-r--r--src/ui/listwidget.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/listwidget.c b/src/ui/listwidget.c
index ac64091f..942c46dd 100644
--- a/src/ui/listwidget.c
+++ b/src/ui/listwidget.c
@@ -199,6 +199,7 @@ int visCount_ListWidget(const iListWidget *d) {
199 (int) size_PtrArray(&d->items)); 199 (int) size_PtrArray(&d->items));
200} 200}
201 201
202#if 0
202static iRanges visRange_ListWidget_(const iListWidget *d) { 203static iRanges visRange_ListWidget_(const iListWidget *d) {
203 if (d->itemHeight == 0) { 204 if (d->itemHeight == 0) {
204 return (iRanges){ 0, 0 }; 205 return (iRanges){ 0, 0 };
@@ -207,6 +208,7 @@ static iRanges visRange_ListWidget_(const iListWidget *d) {
207 vis.end = iMin(size_PtrArray(&d->items), vis.start + visCount_ListWidget(d) + 1); 208 vis.end = iMin(size_PtrArray(&d->items), vis.start + visCount_ListWidget(d) + 1);
208 return vis; 209 return vis;
209} 210}
211#endif
210 212
211size_t itemIndex_ListWidget(const iListWidget *d, iInt2 pos) { 213size_t itemIndex_ListWidget(const iListWidget *d, iInt2 pos) {
212 const iRect bounds = innerBounds_Widget(constAs_Widget(d)); 214 const iRect bounds = innerBounds_Widget(constAs_Widget(d));
@@ -339,11 +341,11 @@ static void drawItem_ListWidget_(const iListWidget *d, iPaint *p, size_t index,
339 const iRect itemRect = { pos, init_I2(width_Rect(bounds), d->itemHeight) }; 341 const iRect itemRect = { pos, init_I2(width_Rect(bounds), d->itemHeight) };
340 class_ListItem(item)->draw(item, p, itemRect, d); 342 class_ListItem(item)->draw(item, p, itemRect, d);
341} 343}
342#endif
343 344
344static const iListItem *item_ListWidget_(const iListWidget *d, size_t pos) { 345static const iListItem *item_ListWidget_(const iListWidget *d, size_t pos) {
345 return constAt_PtrArray(&d->items, pos); 346 return constAt_PtrArray(&d->items, pos);
346} 347}
348#endif
347 349
348static void draw_ListWidget_(const iListWidget *d) { 350static void draw_ListWidget_(const iListWidget *d) {
349 const iWidget *w = constAs_Widget(d); 351 const iWidget *w = constAs_Widget(d);