Changeset 24139
- Timestamp:
- 02/26/08 08:27:24 (9 months ago)
- Location:
- haiku/trunk
- Files:
-
- 2 modified
-
headers/os/interface/ListView.h (modified) (1 diff)
-
src/kits/interface/ListView.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
haiku/trunk/headers/os/interface/ListView.h
r24092 r24139 161 161 int32 _CalcFirstSelected(int32 after); 162 162 int32 _CalcLastSelected(int32 before); 163 void _RecalcItemTops(int32 start );163 void _RecalcItemTops(int32 start, int32 end = -1); 164 164 virtual void DrawItem(BListItem* item, BRect itemRect, 165 165 bool complete = false); -
haiku/trunk/src/kits/interface/ListView.cpp
r24092 r24139 1532 1532 // NOTE: this is only important if the selection status 1533 1533 // of both items is not the same 1534 int32 first = min_c(a, b); 1535 int32 last = max_c(a, b); 1534 1536 if (ItemAt(a)->IsSelected() != ItemAt(b)->IsSelected()) { 1535 int32 first = min_c(a, b); 1536 int32 last = max_c(a, b); 1537 if (first < fFirstSelected || last > fLastSelected) { 1538 first = min_c(first, fFirstSelected); 1539 last = max_c(last, fLastSelected); 1540 _RescanSelection(first, last); 1541 } 1537 if (first < fFirstSelected || last > fLastSelected) 1538 _RescanSelection(min_c(first, fFirstSelected), min_c(last, fLastSelected)); 1542 1539 // though the actually selected items stayed the 1543 1540 // same, the selection has still changed … … 1545 1542 } 1546 1543 1544 ItemAt(a)->SetTop(bFrame.top); 1545 ItemAt(b)->SetTop(aFrame.top); 1546 1547 1547 // take care of invalidation 1548 1548 if (Window()) { 1549 1549 // NOTE: window looper is assumed to be locked! 1550 1550 if (aFrame.Height() != bFrame.Height()) { 1551 ItemAt(a)->SetTop(bFrame.top); 1552 ItemAt(b)->SetTop(aFrame.top); 1551 _RecalcItemTops(first, last); 1553 1552 // items in between shifted visually 1554 1553 Invalidate(aFrame | bFrame); … … 1677 1676 1678 1677 void 1679 BListView::_RecalcItemTops(int32 start )1678 BListView::_RecalcItemTops(int32 start, int32 end) 1680 1679 { 1681 1680 int32 count = CountItems(); 1682 1681 if ((start < 0) || (start >= count)) 1683 1682 return; 1683 1684 if (end >= 0) 1685 count = end + 1; 1686 1684 1687 float top = (start == 0) ? 0.0 : ItemAt(start - 1)->Bottom() + 1.0; 1685 1688 1686 for (int32 i = start; i < CountItems(); i++) {1689 for (int32 i = start; i < count; i++) { 1687 1690 BListItem *item = ItemAt(i); 1688 1691 item->SetTop(top);
