summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2024-01-02 20:55:44 +0200
committerGitHub <noreply@github.com>2024-01-02 20:55:44 +0200
commit602a2af309bd66f76bcf4ca10515a10ca57aa5d6 (patch)
treef049a966ae0284d04411e3876b1415ab8a9f4044 /indra/newview
parent1ffa0ce510620c81df03e7c9a2ff6fedb7ce0241 (diff)
SL-20759 Ctrl+O should close Avatar floater if Wearing tab is opened
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpaneloutfitsinventory.h3
-rw-r--r--indra/newview/llsidepanelappearance.cpp9
-rw-r--r--indra/newview/llsidepanelappearance.h2
-rw-r--r--indra/newview/llviewermenu.cpp8
4 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 50d7074d4b..f9e29c0a92 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -61,6 +61,8 @@ public:
void openApearanceTab(const std::string& tab_name);
+ bool isCOFPanelActive() const;
+
protected:
void updateVerbs();
@@ -73,7 +75,6 @@ private:
protected:
void initTabPanels();
void onTabChange();
- bool isCOFPanelActive() const;
bool isOutfitsListPanelActive() const;
bool isOutfitsGalleryPanelActive() const;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index aed9dba7ef..7571d361a4 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -361,6 +361,15 @@ void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string
}
}
+bool LLSidepanelAppearance::isCOFPanelVisible()
+{
+ if (mPanelOutfitsInventory && mPanelOutfitsInventory->getVisible())
+ {
+ return mPanelOutfitsInventory->isCOFPanelActive();
+ }
+ return false;
+}
+
void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)
{
if (!mOutfitEdit || mOutfitEdit->getVisible() == visible)
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index bb9709a2b8..e67652d6f7 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -66,6 +66,8 @@ public:
void updateToVisibility( const LLSD& new_visibility );
LLPanelEditWearable* getWearable(){ return mEditWearable; }
+ bool isCOFPanelVisible();
+
private:
void onFilterEdit(const std::string& search_string);
void onVisibilityChanged ( const LLSD& new_visibility );
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 553eaaf9b2..0e3527ec36 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -102,6 +102,7 @@
#include "llsceneview.h"
#include "llscenemonitor.h"
#include "llselectmgr.h"
+#include "llsidepanelappearance.h"
#include "llspellcheckmenuhandler.h"
#include "llstatusbar.h"
#include "lltextureview.h"
@@ -6651,6 +6652,13 @@ void handle_edit_outfit()
void handle_now_wearing()
{
+ LLSidepanelAppearance *panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance"));
+ if (panel_appearance && panel_appearance->isInVisibleChain() && panel_appearance->isCOFPanelVisible())
+ {
+ LLFloaterReg::findInstance("appearance")->closeFloater();
+ return;
+ }
+
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));
}