Fixed Multicolumn view filtering item arrangement. This relates to bug 146.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>

(cherry picked from commit 38e12d6e12)
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
r14.0.x
Michele Calgaro 10 years ago
parent fbf8ee2262
commit 6d346d4d84

@ -2347,14 +2347,15 @@ void TQIconViewItem::checkRect()
When an item is inserted the TQIconView allocates a position for it. When an item is inserted the TQIconView allocates a position for it.
Existing items are rearranged if autoArrange() is TRUE. The Existing items are rearranged if autoArrange() is TRUE. The
default arrangement is \c LeftToRight -- the TQIconView fills up default arrangement is \c LeftToRight -- the TQIconView fills
the \e left-most column from top to bottom, then moves one column the \e top-most row from left to right, then moves one row \e down
\e right and fills that from top to bottom and so on. The and fills that row from left to right and so on. The
arrangement can be modified with any of the following approaches: arrangement can be modified with any of the following approaches:
\list \list
\i Call setArrangement(), e.g. with \c TopToBottom which will fill \i Call setArrangement(), e.g. with \c TopToBottom which will fill up
the \e top-most row from left to right, then moves one row \e down the \e left-most column from top to bottom, then moves one column
and fills that row from left to right and so on. \e right and fills that from top to bottom and so on.
\i Construct each TQIconViewItem using a constructor which allows \i Construct each TQIconViewItem using a constructor which allows
you to specify which item the new one is to follow. you to specify which item the new one is to follow.
\i Call setSorting() or sort() to sort the items. \i Call setSorting() or sort() to sort the items.
@ -6040,7 +6041,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
} }
} else { // -------------------------------- SOUTH ------------------------------ } else { // -------------------------------- TopToBottom ------------------------------
int x = y; int x = y;
@ -6075,6 +6076,7 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
// now move the items // now move the items
item = begin; item = begin;
TQIconViewItem *prevVisibleItem = NULL;
for (;;) { for (;;) {
item->dirty = FALSE; item->dirty = FALSE;
if ( d->itemTextPos == Bottom ) { if ( d->itemTextPos == Bottom ) {
@ -6082,15 +6084,16 @@ TQIconViewItem *TQIconView::makeRowLayout( TQIconViewItem *begin, int &y, bool &
changed = item->move( x + ( w - item->width() ) / 2, d->spacing ) || changed; changed = item->move( x + ( w - item->width() ) / 2, d->spacing ) || changed;
else else
changed = item->move( x + ( w - item->width() ) / 2, changed = item->move( x + ( w - item->width() ) / 2,
item->prev->y() + item->prev->height() + d->spacing ) || changed; prevVisibleItem->y() + prevVisibleItem->height() + d->spacing ) || changed;
} else { } else {
if ( item == begin ) if ( item == begin )
changed = item->move( x, d->spacing ) || changed; changed = item->move( x, d->spacing ) || changed;
else else
changed = item->move( x, item->prev->y() + item->prev->height() + d->spacing ) || changed; changed = item->move( x, prevVisibleItem->y() + prevVisibleItem->height() + d->spacing ) || changed;
} }
if ( item == end ) if ( item == end )
break; break;
prevVisibleItem = item;
item = item->next; item = item->next;
while (item && (item->isVisible() == FALSE)) { while (item && (item->isVisible() == FALSE)) {
item = item->next; item = item->next;

Loading…
Cancel
Save