Commits

Merov Linden committed 4002a6f Merge

STORM-301 : merge to viewer-beta

  • Participants
  • Parent commits 34fe721, 248a3ec

Comments (0)

Files changed (5)

indra/llui/llfloater.cpp

 	mTornOff(false),
 	mHasBeenDraggedWhileMinimized(FALSE),
 	mPreviousMinimizedBottom(0),
-	mPreviousMinimizedLeft(0)
+	mPreviousMinimizedLeft(0),
+	mMinimizeSignal(NULL)
 //	mNotificationContext(NULL)
 {
 	mHandle.bind(this);
 	setVisible(false); // We're not visible if we're destroyed
 	storeVisibilityControl();
 	storeDockStateControl();
+
+	delete mMinimizeSignal;
 }
 
 void LLFloater::storeRectControl()
 
 	if (minimize == mMinimized) return;
 
+	if(mMinimizeSignal)
+	{
+		(*mMinimizeSignal)(this, LLSD(minimize));
+	}
+
 	if (minimize)
 	{
 		// minimized flag should be turned on before release focus
 	}
 }
 
+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)

indra/llui/llfloater.h

 	// 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);
 
 	// 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;

indra/newview/llsidepanelappearance.cpp

 
 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();

indra/newview/llsidepanelappearance.h

 	void setWearablesLoading(bool val);
 	void showDefaultSubpart();
 	void updateScrollingPanelList();
+	void updateToVisibility( const LLSD& new_visibility );
 
 private:
 	void onFilterEdit(const std::string& search_string);

indra/newview/llsidetray.cpp

 #include "llwindow.h"//for SetCursor
 #include "lltransientfloatermgr.h"
 
+#include "llsidepanelappearance.h"
+
 //#include "llscrollcontainer.h"
 
 using namespace std;
 	}
 }
 
+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();
 	// 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();