From bdd4cb5963df9550eb8e9c0bca0eff0010b44b1e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Wed, 12 Apr 2023 19:11:59 +0300 Subject: SL-19544 WIP show drag handler control --- indra/llui/lllayoutstack.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui/lllayoutstack.h') diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index f772dbc6b4..9a53a7f787 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -59,6 +59,8 @@ public: Optional drag_handle_thickness; Optional drag_handle_shift; + Optional drag_handle_color; + Params(); }; @@ -127,6 +129,7 @@ private: S32 mDragHandleSecondIndent; S32 mDragHandleThickness; S32 mDragHandleShift; + LLUIColor mDragHandleColor; }; // end class LLLayoutStack -- cgit v1.3 From 6e2e9d5904b3cc89deb755f3552d915104065aa0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 12 May 2023 18:26:02 +0300 Subject: SL-19649 Adjust other classes for new deleteAllChildren mechanics --- indra/llui/lllayoutstack.cpp | 19 ++++++++++++++++--- indra/llui/lllayoutstack.h | 1 + indra/llui/llmenugl.cpp | 7 +++++++ indra/llui/llmenugl.h | 1 + indra/newview/llinspecttoast.cpp | 7 +++++++ indra/newview/llinventorymodel.cpp | 5 ++++- indra/newview/lltooldraganddrop.cpp | 4 ++-- 7 files changed, 38 insertions(+), 6 deletions(-) (limited to 'indra/llui/lllayoutstack.h') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 8a011b4890..08ce31ffc5 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -284,6 +284,17 @@ void LLLayoutStack::draw() } } +void LLLayoutStack::deleteAllChildren() +{ + mPanels.clear(); + LLView::deleteAllChildren(); + + // Not really needed since nothing is left to + // display, but for the sake of consistency + updateFractionalSizes(); + mNeedsLayout = true; +} + void LLLayoutStack::removeChild(LLView* view) { LLLayoutPanel* embedded_panelp = findEmbeddedPanel(dynamic_cast(view)); @@ -291,12 +302,14 @@ void LLLayoutStack::removeChild(LLView* view) if (embedded_panelp) { mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); - delete embedded_panelp; + LLView::removeChild(view); updateFractionalSizes(); mNeedsLayout = true; } - - LLView::removeChild(view); + else + { + LLView::removeChild(view); + } } BOOL LLLayoutStack::postBuild() diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9a53a7f787..02685281ef 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -69,6 +69,7 @@ public: virtual ~LLLayoutStack(); /*virtual*/ void draw(); + /*virtual*/ void deleteAllChildren(); /*virtual*/ void removeChild(LLView*); /*virtual*/ BOOL postBuild(); /*virtual*/ bool addChild(LLView* child, S32 tab_group = 0); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 35f2930800..1666ff8c98 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1891,6 +1891,13 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group) return false; } + +void LLMenuGL::deleteAllChildren() +{ + mItems.clear(); + LLUICtrl::deleteAllChildren(); +} + void LLMenuGL::removeChild( LLView* ctrl) { // previously a dynamic_cast with if statement to check validity diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 47a46510b3..87e3f18ebc 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -449,6 +449,7 @@ public: /*virtual*/ void drawBackground(LLMenuItemGL* itemp, F32 alpha); /*virtual*/ void setVisible(BOOL visible); /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0); + /*virtual*/ void deleteAllChildren(); /*virtual*/ void removeChild( LLView* ctrl); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 68801b0895..6f93a78ca6 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -47,6 +47,7 @@ public: /*virtual*/ void onOpen(const LLSD& notification_id); /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); + /*virtual*/ void deleteAllChildren(); /*virtual*/ void removeChild(LLView* child); private: void onToastDestroy(LLToast * toast); @@ -122,6 +123,12 @@ BOOL LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask) return LLFloater::handleToolTip(x, y, mask); } +void LLInspectToast::deleteAllChildren() +{ + mPanel = NULL; + LLInspect::deleteAllChildren(); +} + // virtual void LLInspectToast::removeChild(LLView* child) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c65901a754..bc0d523bd2 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -906,7 +906,10 @@ const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot( } } - if(rv.isNull() && root_id.notNull() && preferred_type != LLFolderType::FT_MARKETPLACE_LISTINGS) + if(rv.isNull() + && root_id.notNull() + && preferred_type != LLFolderType::FT_MARKETPLACE_LISTINGS + && preferred_type != LLFolderType::FT_OUTBOX) { // if it does not exists, it should either be added // to createCommonSystemCategories or server should diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index d10b999220..78e068f808 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1733,7 +1733,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( } const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX); - if(gInventory.isObjectDescendentOf(item->getUUID(), outbox_id)) + if(outbox_id.notNull() && gInventory.isObjectDescendentOf(item->getUUID(), outbox_id)) { // Legacy return ACCEPT_NO; @@ -2160,7 +2160,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( } const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX); - if(gInventory.isObjectDescendentOf(category->getUUID(), outbox_id)) + if(outbox_id.notNull() && gInventory.isObjectDescendentOf(category->getUUID(), outbox_id)) { // Legacy return ACCEPT_NO; -- cgit v1.3 From 65fe37a93029e17f45e488619a5e589a2983757f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 24 Jun 2023 01:49:27 +0300 Subject: SL-19604 Fix gallery view having huge ident at the bottom --- indra/llui/lllayoutstack.cpp | 9 +++++++++ indra/llui/lllayoutstack.h | 1 + indra/newview/llpanelmaininventory.cpp | 6 ++++++ indra/newview/llpanelmaininventory.h | 3 ++- .../newview/skins/default/xui/en/panel_main_inventory.xml | 14 +++++++------- 5 files changed, 25 insertions(+), 8 deletions(-) (limited to 'indra/llui/lllayoutstack.h') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 08ce31ffc5..b1968e6a42 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -523,6 +523,15 @@ void LLLayoutStack::updateLayout() mNeedsLayout = continue_animating; } // end LLLayoutStack::updateLayout +void LLLayoutStack::setPanelSpacing(S32 val) +{ + if (mPanelSpacing != val) + { + mPanelSpacing = val; + mNeedsLayout = true; + } +} + LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const { if (!panelp) return NULL; diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 02685281ef..000b919ae7 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -91,6 +91,7 @@ public: void updateLayout(); S32 getPanelSpacing() const { return mPanelSpacing; } + void setPanelSpacing(S32 val); static void updateClass(); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5ae61f0c36..27c8f10889 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -256,6 +256,7 @@ BOOL LLPanelMainInventory::postBuild() mCombinationViewPanel = getChild("combination_view_inventory"); mCombinationGalleryLayoutPanel = getChild("comb_gallery_layout"); mCombinationListLayoutPanel = getChild("comb_inventory_layout"); + mCombinationLayoutStack = getChild("combination_view_stack"); mCombinationInventoryPanel = getChild("comb_single_folder_inv"); LLInventoryFilter& comb_inv_filter = mCombinationInventoryPanel->getFilter(); @@ -2371,6 +2372,7 @@ void LLPanelMainInventory::updatePanelVisibility() comb_gallery_filter.setFilterThumbnails(LLInventoryFilter::FILTER_INCLUDE_THUMBNAILS); comb_gallery_filter.markDefault(); + mCombinationLayoutStack->setPanelSpacing(0); mCombinationGalleryLayoutPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); mCombinationGalleryPanel->setVisible(mSingleFolderMode && isGalleryViewMode()); // to prevent or process updates mCombinationListLayoutPanel->setVisible(mSingleFolderMode && isListViewMode()); @@ -2390,6 +2392,10 @@ void LLPanelMainInventory::updateCombinationVisibility() { bool is_gallery_empty = !mCombinationGalleryPanel->hasVisibleItems(); bool show_inv_pane = mCombinationInventoryPanel->hasVisibleItems() || is_gallery_empty || mForceShowInvLayout; + + const S32 DRAG_HANDLE_PADDING = 12; // for drag handle to not overlap gallery when both inventories are visible + mCombinationLayoutStack->setPanelSpacing(show_inv_pane ? DRAG_HANDLE_PADDING : 0); + mCombinationGalleryLayoutPanel->setVisible(!is_gallery_empty); mCombinationListLayoutPanel->setVisible(show_inv_pane); mCombinationInventoryPanel->getRootFolder()->setForceArrange(!show_inv_pane); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index bdc62fd8f7..79501e63bc 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -210,7 +210,8 @@ private: LLInventorySingleFolderPanel* mCombinationInventoryPanel; LLInventoryGallery* mCombinationGalleryPanel; LLPanel* mCombinationGalleryLayoutPanel; - LLPanel* mCombinationListLayoutPanel; + LLLayoutPanel* mCombinationListLayoutPanel; + LLLayoutStack* mCombinationLayoutStack; 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 b735dcf528..f7a9c552cc 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -271,7 +271,7 @@