summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-12-14 17:49:25 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-12-14 17:49:25 -0800
commite8bff548ff7374c263c2bc38a337e8841bc2761f (patch)
tree7f2e6705d79a504925fc7c3e799cd81d85ee4240 /indra/llui
parentfa822a2ae50f8d070da19c64b3b3c03643d7c8b2 (diff)
parentba8d9afe17a5eb75b7c89b6a1400e412bb473379 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderview.h16
-rw-r--r--indra/llui/llscrolllistctrl.cpp9
2 files changed, 23 insertions, 2 deletions
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 525efe425a..d4a1434c73 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -341,16 +341,28 @@ public:
virtual void doItem(LLFolderViewItem* item) = 0;
};
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLSelectFirstFilteredItem
+//
+// This will select the first *item* found in the hierarchy. If no item can be
+// selected, the first matching folder will.
+// Since doFolder() is done first but we prioritize item selection, we let the
+// first filtered folder set the selection and raise a folder flag.
+// The selection might be overridden by the first filtered item in doItem()
+// which checks an item flag. Since doFolder() checks the item flag too, the first
+// item will still be selected if items were to be done first and folders second.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
{
public:
- LLSelectFirstFilteredItem() : mItemSelected(FALSE) {}
+ LLSelectFirstFilteredItem() : mItemSelected(FALSE), mFolderSelected(FALSE) {}
virtual ~LLSelectFirstFilteredItem() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
- BOOL wasItemSelected() { return mItemSelected; }
+ BOOL wasItemSelected() { return mItemSelected || mFolderSelected; }
protected:
BOOL mItemSelected;
+ BOOL mFolderSelected;
};
class LLOpenFilteredFolders : public LLFolderViewFunctor
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 7ed7042aff..2bd2294ea2 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -580,6 +580,15 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos, BOOL r
addColumn(col_params);
}
+ S32 num_cols = item->getNumColumns();
+ S32 i = 0;
+ for (LLScrollListCell* cell = item->getColumn(i); i < num_cols; cell = item->getColumn(++i))
+ {
+ if (i >= (S32)mColumnsIndexed.size()) break;
+
+ cell->setWidth(mColumnsIndexed[i]->getWidth());
+ }
+
updateLineHeightInsert(item);
updateLayout();