summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-07 15:13:47 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-04-07 15:13:47 +0300
commitd5a949d97a67c8b9e551fc4b22d4c901eaf1d91a (patch)
tree2457466043af3186d2a0631dd88f1466bc5d3f9d /indra
parent3c23be758ef8804047bf96d0619bd95e7760e904 (diff)
SL-19544 WIP Combination view first pass
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventorygallery.cpp5
-rw-r--r--indra/newview/llinventorygallery.h1
-rw-r--r--indra/newview/llpanelmaininventory.cpp90
-rw-r--r--indra/newview/llpanelmaininventory.h6
-rw-r--r--indra/newview/skins/default/xui/en/panel_inventory_gallery.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml74
6 files changed, 169 insertions, 9 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index c3e06fafc5..e38f2ef849 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1128,6 +1128,11 @@ bool LLInventoryGallery::checkAgainstFilterType(const LLUUID& object_id)
}
return true;
}
+
+bool LLInventoryGallery::hasVisibleItems()
+{
+ return mItemsAddedCount > 0;
+}
//-----------------------------
// LLInventoryGalleryItem
//-----------------------------
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 98ed91df19..5634c63072 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -122,6 +122,7 @@ public:
LLInventoryFilter::ESearchType getSearchType() { return mSearchType; }
bool hasDescendents(const LLUUID& cat_id);
+ bool hasVisibleItems();
protected:
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 5535d64d27..e5c0e4cf9c 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -252,6 +252,19 @@ BOOL LLPanelMainInventory::postBuild()
mInventoryGalleryPanel = getChild<LLInventoryGallery>("gallery_view_inv");
mGalleryRootUpdatedConnection = mInventoryGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this));
+ mCombinationPanelInventory = getChild<LLInventorySingleFolderPanel>("comb_single_folder_inv");
+ LLInventoryFilter& comb_inv_filter = mCombinationPanelInventory->getFilter();
+ comb_inv_filter.setFilterThumbnails(LLInventoryFilter::FILTER_EXCLUDE_THUMBNAILS);
+ comb_inv_filter.markDefault();
+ mCombinationPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mCombinationPanelInventory, _1, _2));
+ mCombinationPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, false));
+
+ mCombinationGalleryPanel = getChild<LLInventoryGallery>("comb_gallery_view_inv");
+ LLInventoryFilter& comb_gallery_filter = mCombinationGalleryPanel->getFilter();
+ comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_ONLY_THUMBNAILS);
+ comb_gallery_filter.markDefault();
+ mCombinationGalleryPanel->setRootChangedCallback(boost::bind(&LLPanelMainInventory::onCombinationRootChanged, this, true));
+
initListCommandsHandlers();
const std::string texture_upload_cost_str = std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost());
@@ -887,6 +900,7 @@ void LLPanelMainInventory::draw()
}
LLPanel::draw();
updateItemcountText();
+ updateCombinationVisibility();
}
void LLPanelMainInventory::updateItemcountText()
@@ -1514,6 +1528,10 @@ void LLPanelMainInventory::onUpFolderClicked()
{
mInventoryGalleryPanel->setRootFolder(cat->getParentUUID());
}
+ if(isCombinationViewMode())
+ {
+ mCombinationPanelInventory->changeFolderRoot(cat->getParentUUID());
+ }
}
}
}
@@ -1528,6 +1546,10 @@ void LLPanelMainInventory::onBackFolderClicked()
{
mInventoryGalleryPanel->onBackwardFolder();
}
+ if(isCombinationViewMode())
+ {
+ mCombinationPanelInventory->onBackwardFolder();
+ }
}
void LLPanelMainInventory::onForwardFolderClicked()
@@ -1540,6 +1562,10 @@ void LLPanelMainInventory::onForwardFolderClicked()
{
mInventoryGalleryPanel->onForwardFolder();
}
+ if(isCombinationViewMode())
+ {
+ mCombinationPanelInventory->onForwardFolder();
+ }
}
void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool clear_nav_history)
@@ -2099,6 +2125,26 @@ void LLPanelMainInventory::updateTitle()
updateNavButtons();
}
+void LLPanelMainInventory::onCombinationRootChanged(bool gallery_clicked)
+{
+ if(gallery_clicked)
+ {
+ mCombinationPanelInventory->changeFolderRoot(mCombinationGalleryPanel->getRootFolder());
+ }
+ else
+ {
+ mCombinationGalleryPanel->setRootFolder(mCombinationPanelInventory->getSingleFolderRoot());
+ }
+
+ updateTitle();
+}
+
+void LLPanelMainInventory::updateCombinationVisibility()
+{
+ getChild<LLLayoutPanel>("comb_gallery_layout")->setVisible(mCombinationGalleryPanel->hasVisibleItems());
+ getChild<LLView>("border")->setVisible(mCombinationGalleryPanel->hasVisibleItems());
+}
+
void LLPanelMainInventory::updateNavButtons()
{
if(isListViewMode())
@@ -2111,6 +2157,11 @@ void LLPanelMainInventory::updateNavButtons()
getChild<LLButton>("back_btn")->setEnabled(mInventoryGalleryPanel->isBackwardAvailable());
getChild<LLButton>("forward_btn")->setEnabled(mInventoryGalleryPanel->isForwardAvailable());
}
+ if(isCombinationViewMode())
+ {
+ getChild<LLButton>("back_btn")->setEnabled(mCombinationPanelInventory->isBackwardAvailable());
+ getChild<LLButton>("forward_btn")->setEnabled(mCombinationPanelInventory->isForwardAvailable());
+ }
const LLViewerInventoryCategory* cat = gInventory.getCategory(getCurrentSFVRoot());
bool up_enabled = (cat && cat->getParentUUID().notNull());
@@ -2131,6 +2182,24 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
{
if(mode != mViewMode)
{
+ std::list<LLUUID> forward_history;
+ std::list<LLUUID> backward_history;
+ switch(mViewMode)
+ {
+ case MODE_LIST:
+ forward_history = mSingleFolderPanelInventory->getNavForwardList();
+ backward_history = mSingleFolderPanelInventory->getNavBackwardList();
+ break;
+ case MODE_GALLERY:
+ forward_history = mInventoryGalleryPanel->getNavForwardList();
+ backward_history = mInventoryGalleryPanel->getNavBackwardList();
+ break;
+ case MODE_COMBINATION:
+ forward_history = mCombinationPanelInventory->getNavForwardList();
+ backward_history = mCombinationPanelInventory->getNavBackwardList();
+ break;
+ }
+
LLUUID cur_root = getCurrentSFVRoot();
mViewMode = mode;
@@ -2141,15 +2210,25 @@ void LLPanelMainInventory::setViewMode(EViewModeType mode)
if(isListViewMode())
{
mSingleFolderPanelInventory->changeFolderRoot(cur_root);
- mSingleFolderPanelInventory->setNavForwardList(mInventoryGalleryPanel->getNavForwardList());
- mSingleFolderPanelInventory->setNavBackwardList(mInventoryGalleryPanel->getNavBackwardList());
+ mSingleFolderPanelInventory->setNavForwardList(forward_history);
+ mSingleFolderPanelInventory->setNavBackwardList(backward_history);
}
if(isGalleryViewMode())
{
mInventoryGalleryPanel->setRootFolder(cur_root);
- mInventoryGalleryPanel->setNavForwardList(mSingleFolderPanelInventory->getNavForwardList());
- mInventoryGalleryPanel->setNavBackwardList(mSingleFolderPanelInventory->getNavBackwardList());
+ mInventoryGalleryPanel->setNavForwardList(forward_history);
+ mInventoryGalleryPanel->setNavBackwardList(backward_history);
}
+ if(isCombinationViewMode())
+ {
+ mCombinationPanelInventory->changeFolderRoot(cur_root);
+ mCombinationGalleryPanel->setRootFolder(cur_root);
+ mCombinationPanelInventory->setNavForwardList(forward_history);
+ mCombinationPanelInventory->setNavBackwardList(backward_history);
+ mCombinationGalleryPanel->setNavForwardList(forward_history);
+ mCombinationGalleryPanel->setNavBackwardList(backward_history);
+ }
+
updateNavButtons();
onFilterSelected();
@@ -2178,8 +2257,7 @@ LLUUID LLPanelMainInventory::getCurrentSFVRoot()
}
if(isCombinationViewMode())
{
- //todo: should get actual Combination view root
- return mSingleFolderPanelInventory->getSingleFolderRoot();
+ return mCombinationPanelInventory->getSingleFolderRoot();
}
return LLUUID::null;
}
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 4a27bbca4e..bc7ed51465 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -160,6 +160,8 @@ protected:
bool isSaveTextureEnabled(const LLSD& userdata);
void updateItemcountText();
+ void updateCombinationVisibility();
+
void onFocusReceived();
void onSelectSearchType();
void updateSearchTypeCombo();
@@ -190,6 +192,8 @@ private:
EViewModeType mViewMode;
LLInventorySingleFolderPanel* mSingleFolderPanelInventory;
LLInventoryGallery* mInventoryGalleryPanel;
+ LLInventorySingleFolderPanel* mCombinationPanelInventory;
+ LLInventoryGallery* mCombinationGalleryPanel;
boost::signals2::connection mListViewRootUpdatedConnection;
boost::signals2::connection mGalleryRootUpdatedConnection;
@@ -209,6 +213,8 @@ protected:
static bool hasSettingsInventory();
void updateTitle();
void updateNavButtons();
+
+ void onCombinationRootChanged(bool gallery_clicked);
/**
* Set upload cost in "Upload" sub menu.
*/
diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery.xml
index b32d592bf6..2b80e30696 100644
--- a/indra/newview/skins/default/xui/en/panel_inventory_gallery.xml
+++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
background_visible="true"
- bg_alpha_color="DkGray"
+ bg_alpha_color="InventoryBackgroundColor"
border="false"
follows="all"
height="390"
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 dc8720b9d1..6eb1cf0498 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -286,8 +286,7 @@
name="single_folder_inv"
follows="all"
left="0"
- top="0"
- top_pad="5"
+ top_pad="1"
height="372"
width="312"
layout="topleft"
@@ -338,5 +337,76 @@
top_delta="0"
visible="false"
width="312">
+ <layout_stack
+ follows="all"
+ height="372"
+ width="312"
+ animate="false"
+ top="0"
+ left="0"
+ orientation="vertical">
+ <layout_panel
+ border="false"
+ bevel_style="in"
+ user_resize="true"
+ auto_resize="true"
+ height="186"
+ width="312"
+ min_width="150"
+ name="comb_gallery_layout">
+ <panel
+ class="inventory_gallery"
+ filename="panel_inventory_gallery.xml"
+ left="0"
+ top_pad="0"
+ height="178"
+ width="312"
+ name="comb_gallery_view_inv"
+ background_visible="true"
+ follows="all"
+ layout="topleft">
+ </panel>
+ <view_border
+ bevel_style="none"
+ height="0"
+ follows="left|bottom|right"
+ layout="topleft"
+ left="6"
+ name="border"
+ top_pad="8"
+ width="300"/>
+ </layout_panel>
+ <layout_panel
+ border="false"
+ bevel_style="in"
+ user_resize="true"
+ auto_resize="true"
+ height="186"
+ width="312"
+ name="comb_inventory_layout">
+ <single_folder_inventory_panel
+ name="comb_single_folder_inv"
+ follows="all"
+ left="0"
+ top="1"
+ height="181"
+ 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>
</panel>