summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderview.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-20 21:23:34 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-20 21:23:34 +0300
commitc757c29c95f60b174903ced0a9ef9ea352d3bb2f (patch)
treeda3dfe45c4bc1726d894565a2eaaf95baa7e7e1c /indra/llui/llfolderview.cpp
parent72aad484276aeec5446618aeb5f63c64d9f924a5 (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merge branch 'master' into DRTVWR-500
# Conflicts: # indra/newview/pipeline.cpp
Diffstat (limited to 'indra/llui/llfolderview.cpp')
-rw-r--r--indra/llui/llfolderview.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index b05a9807d0..e718fcec46 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -148,7 +148,9 @@ LLFolderView::Params::Params()
: title("title"),
use_label_suffix("use_label_suffix"),
allow_multiselect("allow_multiselect", true),
+ allow_drag("allow_drag", true),
show_empty_message("show_empty_message", true),
+ suppress_folder_menu("suppress_folder_menu", false),
use_ellipses("use_ellipses", false),
options_menu("options_menu", "")
{
@@ -162,11 +164,13 @@ LLFolderView::LLFolderView(const Params& p)
mScrollContainer( NULL ),
mPopupMenuHandle(),
mAllowMultiSelect(p.allow_multiselect),
+ mAllowDrag(p.allow_drag),
mShowEmptyMessage(p.show_empty_message),
mShowFolderHierarchy(FALSE),
mRenameItem( NULL ),
mNeedsScroll( FALSE ),
mUseLabelSuffix(p.use_label_suffix),
+ mSuppressFolderMenu(p.suppress_folder_menu),
mPinningSelectedItem(FALSE),
mNeedsAutoSelect( FALSE ),
mAutoSelectOverride(FALSE),
@@ -1432,10 +1436,13 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
S32 count = mSelectedItems.size();
+
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
- if ( handled
+ bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected();
+ if ((handled
&& ( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible
- && menu )
+ && menu ) &&
+ !hide_folder_menu)
{
if (mCallbackRegistrar)
{
@@ -1449,7 +1456,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
if (mCallbackRegistrar)
{
mCallbackRegistrar->popScope();
- }
+ }
}
else
{
@@ -1862,6 +1869,20 @@ void LLFolderView::updateMenu()
}
}
+bool LLFolderView::isFolderSelected()
+{
+ selected_items_t::iterator item_iter;
+ for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter)
+ {
+ LLFolderViewFolder* folder = dynamic_cast<LLFolderViewFolder*>(*item_iter);
+ if (folder != NULL)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
bool LLFolderView::selectFirstItem()
{
for (folders_t::iterator iter = mFolders.begin();