summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-26 03:53:05 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-04-26 03:53:17 +0300
commit0091fa0cbaba034da09d42d49f68c63f2cc7df14 (patch)
treeca5a2067f8faf29674095ddfa4aee1ba1660ca22 /indra/newview
parent7c3452fe44eb6a1a0b7a8b927d0b9620142e88d1 (diff)
SL-19583 Uniform risizing for combination inventory view
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llaisapi.cpp21
-rw-r--r--indra/newview/llaisapi.h1
-rw-r--r--indra/newview/llinventorygallery.h1
-rw-r--r--indra/newview/llpanelmaininventory.cpp47
-rw-r--r--indra/newview/llpanelmaininventory.h3
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml114
6 files changed, 98 insertions, 89 deletions
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index e16029f063..6d13a06c54 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -924,6 +924,16 @@ void AISUpdate::clearParseResults()
mCategoryIds.clear();
}
+void AISUpdate::checkTimeout()
+{
+ if (mTimer.hasExpired())
+ {
+ llcoro::suspend();
+ LLCoros::checkStop();
+ mTimer.setTimerExpirySec(debugLoggingEnabled("Inventory") ? EXPIRY_SECONDS_DEBUG : EXPIRY_SECONDS_LIVE);
+ }
+}
+
void AISUpdate::parseUpdate(const LLSD& update)
{
clearParseResults();
@@ -1281,12 +1291,7 @@ void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embe
void AISUpdate::parseEmbedded(const LLSD& embedded, S32 depth)
{
- if (mTimer.hasExpired())
- {
- llcoro::suspend();
- LLCoros::checkStop();
- mTimer.setTimerExpirySec(debugLoggingEnabled("Inventory") ? EXPIRY_SECONDS_DEBUG : EXPIRY_SECONDS_LIVE);
- }
+ checkTimeout();
if (embedded.has("links")) // _embedded in a category
{
@@ -1408,6 +1413,8 @@ void AISUpdate::parseEmbeddedCategories(const LLSD& categories, S32 depth)
void AISUpdate::doUpdate()
{
+ checkTimeout();
+
// Do version/descendant accounting.
for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin();
catit != mCatDescendentDeltas.end(); ++catit)
@@ -1571,6 +1578,8 @@ void AISUpdate::doUpdate()
}
}
+ checkTimeout();
+
gInventory.notifyObservers();
}
diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h
index 1969448627..6afbbbd16e 100644
--- a/indra/newview/llaisapi.h
+++ b/indra/newview/llaisapi.h
@@ -123,6 +123,7 @@ public:
void doUpdate();
private:
void clearParseResults();
+ void checkTimeout();
// Debug is very log-heavy, give it more time or it will take forever to process
// Todo: find a way to make throttle static isntead of per-request
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 1760535524..2cf038b7d8 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -128,6 +128,7 @@ public:
bool hasDescendents(const LLUUID& cat_id);
bool hasVisibleItems();
void handleModifiedFilter();
+ LLScrollContainer* getScrollableContainer() { return mScrollPanel; }
protected:
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 98099dd407..7cd6d7cb82 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -266,6 +266,8 @@ BOOL LLPanelMainInventory::postBuild()
comb_gallery_filter.markDefault();
mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true));
+ mCombinationScroller = getChild<LLView>("combination_scroller");
+
initListCommandsHandlers();
const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost());
@@ -928,6 +930,7 @@ void LLPanelMainInventory::draw()
mActivePanel->setSortOrder(order);
mResortActivePanel = false;
}
+
LLPanel::draw();
updateItemcountText();
updateCombinationVisibility();
@@ -1503,7 +1506,7 @@ void LLPanelMainInventory::toggleViewMode()
getChild<LLPanel>("default_inventory_panel")->setVisible(!mSingleFolderMode);
getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
- getChild<LLPanel>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
+ getChild<LLUICtrl>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
getChild<LLLayoutPanel>("nav_buttons")->setVisible(mSingleFolderMode);
getChild<LLButton>("view_mode_btn")->setImageOverlay(mSingleFolderMode ? getString("default_mode_btn") : getString("single_folder_mode_btn"));
@@ -2214,19 +2217,41 @@ void LLPanelMainInventory::updateCombinationVisibility()
{
if(mSingleFolderMode && isCombinationViewMode())
{
- bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems();
- bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout;
- getChild<LLLayoutPanel>("comb_gallery_layout")->setVisible(!is_gallery_empty);
- getChild<LLLayoutPanel>("comb_inventory_layout")->setVisible(show_inv_pane);
- mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane);
- if(mCombinationInventoryPanel->hasVisibleItems())
+ LLRect inner_rect = mCombinationInventoryPanel->getScrollableContainer()->getScrolledViewRect();
+ LLRect inv_rect = mCombinationInventoryPanel->getRect();
+ inv_rect.mBottom = 0;
+ inv_rect.mRight = inv_rect.mLeft + inner_rect.getWidth();
+ if (!mCombinationGalleryPanel->hasVisibleItems() || mCombinationInventoryPanel->hasVisibleItems())
+ {
+ inv_rect.mTop = inv_rect.mBottom + inner_rect.getHeight();
+ }
+ else
{
- mForceShowInvLayout = false;
+ inv_rect.mTop = inv_rect.mBottom;
}
- if(is_gallery_empty)
+
+ inner_rect = mCombinationGalleryPanel->getScrollableContainer()->getScrolledViewRect();
+ LLRect galery_rect = mCombinationGalleryPanel->getRect();
+ galery_rect.mBottom = inv_rect.mTop;
+ if (mCombinationGalleryPanel->hasVisibleItems())
{
- mCombinationGalleryPanel->handleModifiedFilter();
+ mCombinationGalleryPanel->setVisible(true);
+ galery_rect.mTop = galery_rect.mBottom + inner_rect.getHeight();
}
+ else
+ {
+ mCombinationGalleryPanel->setVisible(false);
+ galery_rect.mTop = galery_rect.mBottom;
+ }
+
+ LLRect scroller_rect = mCombinationScroller->getRect();
+ scroller_rect.mBottom = 0;
+ scroller_rect.mTop = scroller_rect.mBottom + inv_rect.getHeight() + galery_rect.getHeight();
+ scroller_rect.mRight = scroller_rect.mLeft + llmax(inv_rect.getWidth(), galery_rect.getWidth());
+
+ mCombinationScroller->setRect(scroller_rect);
+ mCombinationGalleryPanel->handleReshape(galery_rect, false);
+ mCombinationInventoryPanel->handleReshape(inv_rect, false);
getActivePanel()->getRootFolder();
}
@@ -2293,7 +2318,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
getChild<LLPanel>("single_folder_inventory")->setVisible(mSingleFolderMode && isListViewMode());
getChild<LLPanel>("gallery_view_inventory")->setVisible(mSingleFolderMode && isGalleryViewMode());
- getChild<LLPanel>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
+ getChild<LLUICtrl>("combination_view_inventory")->setVisible(mSingleFolderMode && isCombinationViewMode());
if(isListViewMode())
{
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index e5b9ba929d..8e7ad776b0 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -143,8 +143,6 @@ protected:
static BOOL filtersVisible(void* user_data);
void onClearSearch();
- static void onFoldersByName(void *user_data);
- static BOOL checkFoldersByName(void *user_data);
static BOOL incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward);
void onFilterSelected();
@@ -196,6 +194,7 @@ private:
LLInventorySingleFolderPanel* mCombinationInventoryPanel;
LLInventoryGallery* mCombinationGalleryPanel;
+ LLView* mCombinationScroller;
boost::signals2::connection mListViewRootUpdatedConnection;
boost::signals2::connection mGalleryRootUpdatedConnection;
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 5bc0113367..f772c1fde2 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -327,7 +327,7 @@
follows="all"
layout="topleft" />
</panel>
- <panel
+ <scroll_container
follows="all"
halign="center"
height="372"
@@ -337,74 +337,48 @@
top_delta="0"
visible="false"
width="312">
- <layout_stack
- follows="all"
- height="372"
- width="312"
- animate="false"
- drag_handle_gap="13"
- drag_handle_thickness="6"
- drag_handle_first_indent="18"
- drag_handle_second_indent="18"
- drag_handle_color="AddPaymentPanel"
- drag_handle_shift="5"
- show_drag_handle="true"
- top="0"
- left="0"
- orientation="vertical">
- <layout_panel
- border="false"
- bevel_style="in"
- user_resize="true"
- auto_resize="true"
- height="246"
- width="312"
- min_width="150"
- name="comb_gallery_layout">
- <panel
- class="inventory_gallery"
- filename="panel_inventory_gallery.xml"
- left="0"
- top_pad="0"
- height="246"
- width="312"
- name="comb_gallery_view_inv"
- background_visible="true"
- follows="all"
- layout="topleft">
+ <panel
+ name="combination_scroller"
+ follows="all"
+ layout="topleft"
+ left="0"
+ top="0"
+ height="20"
+ width="291">
+ <panel
+ class="inventory_gallery"
+ filename="panel_inventory_gallery.xml"
+ follows="left|right"
+ layout="topleft"
+ left="0"
+ top="0"
+ height="10"
+ width="290"
+ name="comb_gallery_view_inv"
+ background_visible="true">
+ </panel>
+ <single_folder_inventory_panel
+ name="comb_single_folder_inv"
+ follows="left|right"
+ layout="topleft"
+ left="0"
+ top="200"
+ height="10"
+ width="290"
+ show_item_link_overlays="true"
+ bg_opaque_color="DkGray2"
+ bg_alpha_color="DkGray2"
+ background_visible="true"
+ border="false"
+ bevel_style="none"
+ scroll.reserve_scroll_corner="false">
+ <item
+ single_folder_mode="true"
+ folder_indentation="-8"/>
+ <folder
+ single_folder_mode="true"
+ folder_indentation="-8"/>
+ </single_folder_inventory_panel>
</panel>
- </layout_panel>
- <layout_panel
- border="false"
- bevel_style="in"
- user_resize="true"
- auto_resize="true"
- height="126"
- width="312"
- name="comb_inventory_layout">
- <single_folder_inventory_panel
- name="comb_single_folder_inv"
- follows="all"
- left="0"
- top="1"
- height="126"
- width="312"
- layout="topleft"
- show_item_link_overlays="true"
- bg_opaque_color="DkGray2"
- bg_alpha_color="DkGray2"
- background_visible="true"
- border="false"
- bevel_style="none"
- scroll.reserve_scroll_corner="false">
- <item
- single_folder_mode="true"
- folder_indentation="-8"/>
- <folder
- single_folder_mode="true"
- folder_indentation="-8"/>
- </single_folder_inventory_panel>
- </layout_panel>
- </layout_stack>
- </panel>
+ </scroll_container>
</panel>