summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-07-15 08:54:55 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-07-15 08:54:55 +0100
commitf65a95157ae603116e61ee0203c0b22e6ac4f903 (patch)
tree84a561d48e9ec2dcec59e435850756d727a8e266 /indra/llui
parentbe299644e3448ad2d613b97aba478c5807f346ec (diff)
parent83e4862f9918037fc89e527d5f8f5b26323f30f0 (diff)
merge from PE's viewer-trunk (viewer-public)
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llflatlistview.cpp22
-rw-r--r--indra/llui/llflatlistview.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 3c79da64f9..ef962ac274 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -610,8 +610,14 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask)
return;
}
- if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection();
- selectItemPair(item_pair, select_item);
+ //no need to do additional commit on selection reset
+ if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection(true);
+
+ //only CTRL usage allows to deselect an item, usual clicking on an item cannot deselect it
+ if (mask & MASK_CONTROL)
+ selectItemPair(item_pair, select_item);
+ else
+ selectItemPair(item_pair, true);
}
void LLFlatListView::onItemRightMouseClick(item_pair_t* item_pair, MASK mask)
@@ -778,6 +784,18 @@ bool LLFlatListView::selectItemPair(item_pair_t* item_pair, bool select)
return true;
}
+void LLFlatListView::scrollToShowFirstSelectedItem()
+{
+ if (!mSelectedItemPairs.size()) return;
+
+ LLRect selected_rc = mSelectedItemPairs.front()->first->getRect();
+
+ if (selected_rc.isValid())
+ {
+ scrollToShowRect(selected_rc);
+ }
+}
+
LLRect LLFlatListView::getLastSelectedItemRect()
{
if (!mSelectedItemPairs.size())
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 50d06fbc94..2c391fdf91 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -297,6 +297,7 @@ public:
bool updateValue(const LLSD& old_value, const LLSD& new_value);
+ void scrollToShowFirstSelectedItem();
void selectFirstItem ();
void selectLastItem ();