summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-10 01:33:43 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-06-10 01:33:43 +0300
commit417dbeb68ef842a8eee22ebab35c89ddee653619 (patch)
tree71102ecb25dff25878402c4336de9f122d1235e2
parent5c6a2779c498e69e36276700283ccfb4bdbfd438 (diff)
SL-19823 Edit not always active #5
-rw-r--r--indra/llui/llfolderview.cpp46
-rw-r--r--indra/newview/llinventorygallery.cpp2
-rw-r--r--indra/newview/llpanelmaininventory.cpp2
3 files changed, 30 insertions, 20 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 19855c9c76..8660048058 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -695,19 +695,14 @@ void LLFolderView::draw()
}
}
- if (mRenameItem
+ if (mRenameItem
&& mRenamer
&& mRenamer->getVisible()
- )
- {
- LLRect renamer_rect;
- localRectToOtherView(mRenamer->getRect(), &renamer_rect, mScrollContainer);
- if (!mScrollContainer->getRect().overlaps(renamer_rect))
- {
- // renamer is not connected to the item we are renaming in any form so manage it manually
- // TODO: consider stopping on any scroll action instead of when out of visible area
- finishRenamingItem();
- }
+ && !getVisibleRect().overlaps(mRenamer->getRect()))
+ {
+ // renamer is not connected to the item we are renaming in any form so manage it manually
+ // TODO: consider stopping on any scroll action instead of when out of visible area
+ finishRenamingItem();
}
// skip over LLFolderViewFolder::draw since we don't want the folder icon, label,
@@ -1851,13 +1846,28 @@ void LLFolderView::update()
}
}
- if (mSignalSelectCallback)
- {
- //RN: we use keyboard focus as a proxy for user-explicit actions
- BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS);
- mSelectSignal(mSelectedItems, take_keyboard_focus);
- }
- mSignalSelectCallback = FALSE;
+ if (mSelectedItems.size())
+ {
+ LLFolderViewItem* item = mSelectedItems.back();
+ // If the goal is to show renamer, don't callback untill
+ // item is visible or is no longer being scrolled to.
+ // Otherwise renamer will be instantly closed
+ // Todo: consider moving renamer out of selection callback
+ if (!mNeedsAutoRename || !mNeedsScroll || item->getVisible())
+ {
+ if (mSignalSelectCallback)
+ {
+ //RN: we use keyboard focus as a proxy for user-explicit actions
+ BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS);
+ mSelectSignal(mSelectedItems, take_keyboard_focus);
+ }
+ mSignalSelectCallback = FALSE;
+ }
+ }
+ else
+ {
+ mSignalSelectCallback = FALSE;
+ }
}
void LLFolderView::dumpSelectionInformation()
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 412e9e9c0b..898bcba494 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1133,7 +1133,7 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_
{
return;
}
- if (mNeedsArrange && item_id.notNull() && scroll_to_selection)
+ if (mNeedsArrange && item_id.notNull())
{
mItemToSelect = item_id;
return;
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index de777fdc1a..e133bd37a1 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -2425,7 +2425,7 @@ void LLPanelMainInventory::updateCombinationVisibility()
}
}
- if (mCombInvUUIDNeedsRename.notNull())
+ if (mCombInvUUIDNeedsRename.notNull() && mCombinationInventoryPanel->areViewsInitialized())
{
mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE);
mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();