From 320baa96467181edeaeffb871bfb0ea53fc465a9 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 14 Feb 2013 20:08:51 +0100 Subject: [PATCH] FIRE-8911 / MAINT-2223: Experimental fix for scroll list columns not resizing properly anymore --- indra/llui/llscrolllistcolumn.cpp | 5 +++++ indra/llui/llscrolllistctrl.cpp | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index af124d9826..cab991b6df 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -236,6 +236,11 @@ void LLScrollColumnHeader::handleReshape(const LLRect& new_rect, bool by_user) // tell scroll list to layout columns again // do immediate update to get proper feedback to resize handle // which needs to know how far the resize actually went + // FIRE-8911/MAINT-2223: Fix for broken column resize + // Need to set mColumnsDirty via dirtyColumns() first + // or nothing would happen at all! + mColumn->mParentCtrl->dirtyColumns(); + // mColumn->mParentCtrl->updateColumns(); } } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 634e0fd567..37c17c0d54 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -647,7 +647,12 @@ S32 LLScrollListCtrl::calcMaxContentWidth() if (mColumnWidthsDirty) { - mColumnWidthsDirty = false; + // FIRE-8911/MAINT-2223: Fix for broken column resize + // This seems to be misplaced here as we would only + // take the first column into account for max + // content width calculation. + //mColumnWidthsDirty = false; + // // update max content width for this column, by looking at all items column->mMaxContentWidth = column->mHeader ? LLFontGL::getFontSansSerifSmall()->getWidth(column->mLabel) + mColumnPadding + HEADING_TEXT_PADDING : 0; item_list::iterator iter; @@ -661,6 +666,9 @@ S32 LLScrollListCtrl::calcMaxContentWidth() } max_item_width += column->mMaxContentWidth; } + // FIRE-8911/MAINT-2223: Fix for broken column resize + mColumnWidthsDirty = false; + // return max_item_width; } @@ -685,11 +693,17 @@ bool LLScrollListCtrl::updateColumnWidths() new_width = (mItemListRect.getWidth() - mTotalStaticColumnWidth - mTotalColumnPadding) / mNumDynamicWidthColumns; } - if (column->getWidth() != new_width) - { - column->setWidth(new_width); - width_changed = true; - } + // FIRE-8911/MAINT-2223: Fix for broken column resize + // This apparently doesn't work as it should, preventing + // a proper resize. Fall back to pre-3.4.3 behavior and + // always assume a changed width. + //if (column->getWidth() != new_width) + //{ + // column->setWidth(new_width); + // width_changed = true; + //} + width_changed = true; + // } return width_changed; }