summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-12 21:11:36 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-12 21:11:36 +0300
commit37530c9d736d90ec29b97e3567346a02e2826f97 (patch)
treece6bbd2c701e9c0bc86a839918bc7f9801ddb4f9
parentc6d2bf93c02c6099f4c86a3379c3e82e21f9f37e (diff)
SL-19544 WIP hide inventory pane in Combination view, if there is no visible items
-rw-r--r--indra/llui/llfolderview.cpp5
-rw-r--r--indra/llui/llfolderview.h4
-rw-r--r--indra/newview/llinventorypanel.cpp4
-rw-r--r--indra/newview/llinventorypanel.h2
-rw-r--r--indra/newview/llpanelmaininventory.cpp12
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml8
6 files changed, 29 insertions, 6 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 734a7599aa..14985c6bad 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -189,7 +189,8 @@ LLFolderView::LLFolderView(const Params& p)
mStatusTextBox(NULL),
mShowItemLinkOverlays(p.show_item_link_overlays),
mViewModel(p.view_model),
- mGroupedItemModel(p.grouped_item_model)
+ mGroupedItemModel(p.grouped_item_model),
+ mForceArrange(false)
{
LLPanel* panel = p.parent_panel;
mParentPanel = panel->getHandle();
@@ -1736,7 +1737,7 @@ void LLFolderView::update()
mNeedsAutoSelect = FALSE;
}
- BOOL is_visible = isInVisibleChain();
+ BOOL is_visible = isInVisibleChain() || mForceArrange;
//Puts folders/items in proper positions
// arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849)
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index fbd8522b19..f19df1d0dc 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -241,6 +241,8 @@ public:
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
void setEnableRegistrar(LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* registrar) { mEnableRegistrar = registrar; }
+ void setForceArrange(bool force) { mForceArrange = force; }
+
LLPanel* getParentPanel() { return mParentPanel.get(); }
// DEBUG only
void dumpSelectionInformation();
@@ -337,6 +339,8 @@ protected:
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* mCallbackRegistrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* mEnableRegistrar;
+
+ bool mForceArrange;
public:
static F32 sAutoOpenTime;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index cc81b53841..2193743a38 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -2221,6 +2221,10 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot()
}
}
+bool LLInventorySingleFolderPanel::hasVisibleItems()
+{
+ return mFolderRoot.get()->hasVisibleChildren();
+}
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/************************************************************************/
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 2b152edada..abd5b4f20b 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -405,6 +405,8 @@ public:
bool isBackwardAvailable();
bool isForwardAvailable();
+ bool hasVisibleItems();
+
void setNavBackwardList(std::list<LLUUID> backward_list) { mBackwardFolders = backward_list; }
void setNavForwardList(std::list<LLUUID> forward_list) { mForwardFolders = forward_list; }
std::list<LLUUID> getNavBackwardList() { return mBackwardFolders; }
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index dfcfc94cea..62b7a38857 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1480,6 +1480,11 @@ void LLPanelMainInventory::setActivePanel()
void LLPanelMainInventory::toggleViewMode()
{
+ if(mSingleFolderMode && isCombinationViewMode())
+ {
+ mCombinationInventoryPanel->getRootFolder()->setForceArrange(false);
+ }
+
mSingleFolderMode = !mSingleFolderMode;
getChild<LLPanel>("default_inventory_panel")->setVisible(!mSingleFolderMode);
@@ -2193,11 +2198,17 @@ void LLPanelMainInventory::updateCombinationVisibility()
if(mSingleFolderMode && isCombinationViewMode())
{
bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems();
+ bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty;
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(is_gallery_empty)
{
mCombinationGalleryPanel->handleModifiedFilter();
}
+
+ getActivePanel()->getRootFolder();
}
}
@@ -2253,6 +2264,7 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
case MODE_COMBINATION:
forward_history = mCombinationInventoryPanel->getNavForwardList();
backward_history = mCombinationInventoryPanel->getNavBackwardList();
+ mCombinationInventoryPanel->getRootFolder()->setForceArrange(false);
break;
}
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 551e9835df..5bc0113367 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -357,7 +357,7 @@
bevel_style="in"
user_resize="true"
auto_resize="true"
- height="186"
+ height="246"
width="312"
min_width="150"
name="comb_gallery_layout">
@@ -366,7 +366,7 @@
filename="panel_inventory_gallery.xml"
left="0"
top_pad="0"
- height="186"
+ height="246"
width="312"
name="comb_gallery_view_inv"
background_visible="true"
@@ -379,7 +379,7 @@
bevel_style="in"
user_resize="true"
auto_resize="true"
- height="186"
+ height="126"
width="312"
name="comb_inventory_layout">
<single_folder_inventory_panel
@@ -387,7 +387,7 @@
follows="all"
left="0"
top="1"
- height="181"
+ height="126"
width="312"
layout="topleft"
show_item_link_overlays="true"