Fix for scrolllist columns not resizing when header width is adjusted.
This commit is contained in:
@@ -570,7 +570,6 @@ S32 LLScrollListCtrl::calcMaxContentWidth()
|
||||
|
||||
if (mColumnWidthsDirty)
|
||||
{
|
||||
mColumnWidthsDirty = false;
|
||||
// update max content width for this column, by looking at all items
|
||||
column->mMaxContentWidth = column->mHeader ? LLFontGL::getFontSansSerifSmall()->getWidth(column->mLabel.getWString()) + mColumnPadding + HEADING_TEXT_PADDING : 0;
|
||||
item_list::iterator iter;
|
||||
@@ -584,8 +583,8 @@ S32 LLScrollListCtrl::calcMaxContentWidth()
|
||||
}
|
||||
max_item_width += column->mMaxContentWidth;
|
||||
}
|
||||
mColumnWidthsDirty = false;
|
||||
|
||||
mMaxContentWidth = max_item_width;
|
||||
return max_item_width;
|
||||
}
|
||||
|
||||
@@ -599,7 +598,7 @@ bool LLScrollListCtrl::updateColumnWidths()
|
||||
if (!column) continue;
|
||||
|
||||
// update column width
|
||||
S32 new_width = column->getWidth();
|
||||
S32 new_width = 0;
|
||||
if (column->mRelWidth >= 0)
|
||||
{
|
||||
new_width = (S32)ll_round(column->mRelWidth*mItemListRect.getWidth());
|
||||
@@ -608,6 +607,10 @@ bool LLScrollListCtrl::updateColumnWidths()
|
||||
{
|
||||
new_width = (mItemListRect.getWidth() - mTotalStaticColumnWidth - mTotalColumnPadding) / mNumDynamicWidthColumns;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_width = column->getWidth();
|
||||
}
|
||||
|
||||
if (column->getWidth() != new_width)
|
||||
{
|
||||
@@ -650,9 +653,9 @@ void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp)
|
||||
}
|
||||
|
||||
|
||||
void LLScrollListCtrl::updateColumns()
|
||||
void LLScrollListCtrl::updateColumns(bool force_update)
|
||||
{
|
||||
if (!mColumnsDirty)
|
||||
if (!mColumnsDirty && !force_update)
|
||||
return;
|
||||
|
||||
mColumnsDirty = false;
|
||||
@@ -706,7 +709,7 @@ void LLScrollListCtrl::updateColumns()
|
||||
}
|
||||
|
||||
// propagate column widths to individual cells
|
||||
if (columns_changed_width)
|
||||
if (columns_changed_width || force_update)
|
||||
{
|
||||
item_list::iterator iter;
|
||||
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
|
||||
|
||||
Reference in New Issue
Block a user