summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Productengine <adyukov@productengine.com>2010-10-11 19:32:42 +0300
committerAndrew Productengine <adyukov@productengine.com>2010-10-11 19:32:42 +0300
commit33bfe43b0cbae946f5c0929f1dacc16e2e9d88f6 (patch)
tree71f77e65ff1ef80f4837242a1bdb98d114738b60
parentae0930751b991737e3fda2b3774411ea71160dca (diff)
STORM-301 FIXED Fixed behaviour of camera on undocked 'My Appearance' tab minimizing.
- Added signal to LLFloater that is emitted on minimize. - Set minimize callback for appearance tab floater in LLSideTrayTab::undock. Method from LLSidePanelAppearance that handles camera issues is called on minimization of floater.
-rw-r--r--indra/llui/llfloater.cpp16
-rw-r--r--indra/llui/llfloater.h4
-rw-r--r--indra/newview/llsidepanelappearance.cpp5
-rw-r--r--indra/newview/llsidepanelappearance.h1
-rw-r--r--indra/newview/llsidetray.cpp20
5 files changed, 45 insertions, 1 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index eb5d7a6b6a..d23b876543 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -231,7 +231,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mTornOff(false),
mHasBeenDraggedWhileMinimized(FALSE),
mPreviousMinimizedBottom(0),
- mPreviousMinimizedLeft(0)
+ mPreviousMinimizedLeft(0),
+ mMinimizeSignal(NULL)
// mNotificationContext(NULL)
{
mHandle.bind(this);
@@ -493,6 +494,8 @@ LLFloater::~LLFloater()
setVisible(false); // We're not visible if we're destroyed
storeVisibilityControl();
storeDockStateControl();
+
+ delete mMinimizeSignal;
}
void LLFloater::storeRectControl()
@@ -997,6 +1000,11 @@ void LLFloater::setMinimized(BOOL minimize)
if (minimize == mMinimized) return;
+ if(mMinimizeSignal)
+ {
+ (*mMinimizeSignal)(this, LLSD(minimize));
+ }
+
if (minimize)
{
// minimized flag should be turned on before release focus
@@ -2810,6 +2818,12 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
}
}
+boost::signals2::connection LLFloater::setMinimizeCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMinimizeSignal) mMinimizeSignal = new commit_signal_t();
+ return mMinimizeSignal->connect(cb);
+}
+
LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node)
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 5ecf515cf9..d26f41b4c7 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -142,6 +142,8 @@ public:
// Don't export top/left for rect, only height/width
static void setupParamsForExport(Params& p, LLView* parent);
+ boost::signals2::connection setMinimizeCallback( const commit_signal_t::slot_type& cb );
+
void initFromParams(const LLFloater::Params& p);
bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
@@ -347,6 +349,8 @@ public:
// Public so external views or floaters can watch for this floater closing
commit_signal_t mCloseSignal;
+ commit_signal_t* mMinimizeSignal;
+
protected:
std::string mRectControl;
std::string mVisibilityControl;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index a3c6a7b6f1..1999f14828 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -183,6 +183,11 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
{
+ updateToVisibility(new_visibility);
+}
+
+void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility)
+{
if (new_visibility.asBoolean())
{
bool is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible();
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index f28cdfa49a..2a83dfbc9d 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -63,6 +63,7 @@ public:
void setWearablesLoading(bool val);
void showDefaultSubpart();
void updateScrollingPanelList();
+ void updateToVisibility( const LLSD& new_visibility );
private:
void onFilterEdit(const std::string& search_string);
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 426ad26f1b..b7470c03bc 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -49,6 +49,8 @@
#include "llwindow.h"//for SetCursor
#include "lltransientfloatermgr.h"
+#include "llsidepanelappearance.h"
+
//#include "llscrollcontainer.h"
using namespace std;
@@ -290,6 +292,13 @@ void LLSideTrayTab::dock()
}
}
+static void on_minimize(LLSidepanelAppearance* panel, LLSD minimized)
+{
+ if (!panel) return;
+ bool visible = !minimized.asBoolean();
+ panel->updateToVisibility(LLSD(visible));
+}
+
void LLSideTrayTab::undock(LLFloater* floater_tab)
{
LLSideTray* side_tray = getSideTray();
@@ -351,6 +360,17 @@ void LLSideTrayTab::undock(LLFloater* floater_tab)
// Set FOLLOWS_ALL flag for the tab to follow floater dimensions upon resizing.
setFollowsAll();
+ // Camera view may need to be changed for appearance panel(STORM-301) on minimize of floater,
+ // so setting callback here.
+ if (getName() == "sidebar_appearance")
+ {
+ LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel());
+ if(panel_appearance)
+ {
+ floater_tab->setMinimizeCallback(boost::bind(&on_minimize, panel_appearance, _2));
+ }
+ }
+
if (!side_tray->getCollapsed())
{
side_tray->collapseSideBar();