diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 12202fd5e31b988c60f785b080d1dcae62426099..75f7f6618f447b37b5defb4e79d395e231f23537 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -43,6 +43,9 @@ void LLDockableFloater::init(LLDockableFloater* thiz)
 	thiz->setCanClose(TRUE);
 	thiz->setCanDock(true);
 	thiz->setCanMinimize(TRUE);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	thiz->setCanCollapse(true);
+// [/SL:KB]
 	thiz->setOverlapsScreenChannel(false);
 	thiz->mForceDocking = false;
 }
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 33c8b2542e34e4cff333fcd5c20dbad2d235f6d6..03e41ac8cc41c72eda21105820433b6e17302ce5 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -5,6 +5,7 @@
  * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  * Second Life Viewer Source Code
  * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2010-2016, Kitty Barnett
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -81,6 +82,9 @@ std::string	LLFloater::sButtonNames[BUTTON_COUNT] =
 {
 	"llfloater_close_btn",		//BUTTON_CLOSE
 	"llfloater_restore_btn",	//BUTTON_RESTORE
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	"llfloater_collapse_btn",	//BUTTON_COLLAPSE
+// [/SL:KB]
 	"llfloater_minimize_btn",	//BUTTON_MINIMIZE
 	"llfloater_tear_off_btn",	//BUTTON_TEAR_OFF
 	"llfloater_dock_btn",		//BUTTON_DOCK
@@ -97,6 +101,9 @@ std::string LLFloater::sButtonToolTipsIndex[BUTTON_COUNT]=
 	"BUTTON_CLOSE_WIN",		//"Close (Ctrl-W)",	//BUTTON_CLOSE
 #endif
 	"BUTTON_RESTORE",		//"Restore",	//BUTTON_RESTORE
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	"BUTTON_COLLAPSE",		//"Collapse",	//BUTTON_COLLAPSE
+// [/SL:KB]
 	"BUTTON_MINIMIZE",		//"Minimize",	//BUTTON_MINIMIZE
 	"BUTTON_TEAR_OFF",		//"Tear Off",	//BUTTON_TEAR_OFF
 	"BUTTON_DOCK",
@@ -107,12 +114,19 @@ LLFloater::click_callback LLFloater::sButtonCallbacks[BUTTON_COUNT] =
 {
 	LLFloater::onClickClose,	//BUTTON_CLOSE
 	LLFloater::onClickMinimize, //BUTTON_RESTORE
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	LLFloater::onClickCollapse, //BUTTON_COLLAPSE
+// [/SL:KB]
 	LLFloater::onClickMinimize, //BUTTON_MINIMIZE
 	LLFloater::onClickTearOff,	//BUTTON_TEAR_OFF
 	LLFloater::onClickDock,		//BUTTON_DOCK
 	LLFloater::onClickHelp		//BUTTON_HELP
 };
 
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+bool LLFloater::sShowCollapseButton = false;
+// [/SL:KB]
+
 LLMultiFloater* LLFloater::sHostp = NULL;
 BOOL			LLFloater::sQuitting = FALSE; // Flag to prevent storing visibility controls while quitting
 
@@ -173,6 +187,9 @@ LLFloater::Params::Params()
 	can_resize_height("can_resize_height", true),
 	can_resize_width("can_resize_width", true),
 	can_minimize("can_minimize", true),
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	can_collapse("can_collapse", true),
+// [/SL:KB]
 	can_close("can_close", true),
 	can_drag_on_left("can_drag_on_left", false),
 	can_tear_off("can_tear_off", true),
@@ -188,12 +205,18 @@ LLFloater::Params::Params()
 	close_image("close_image"),
 	restore_image("restore_image"),
 	minimize_image("minimize_image"),
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	collapse_image("collapse_image"),
+// [/SL:KB]
 	tear_off_image("tear_off_image"),
 	dock_image("dock_image"),
 	help_image("help_image"),
 	close_pressed_image("close_pressed_image"),
 	restore_pressed_image("restore_pressed_image"),
 	minimize_pressed_image("minimize_pressed_image"),
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	collapse_pressed_image("collapse_pressed_image"),
+// [/SL:KB]
 	tear_off_pressed_image("tear_off_pressed_image"),
 	dock_pressed_image("dock_pressed_image"),
 	help_pressed_image("help_pressed_image"),
@@ -252,6 +275,9 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mKey(key),
 	mCanTearOff(p.can_tear_off),
 	mCanMinimize(p.can_minimize),
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	mCanCollapse( (p.can_collapse.isProvided()) ? p.can_collapse : p.can_minimize ),
+// [/SL:KB]
 	mCanClose(p.can_close),
 	mDragOnLeft(p.can_drag_on_left),
 	mResizable(p.can_resize),
@@ -265,6 +291,9 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mLegacyHeaderHeight(p.legacy_header_height),
 	mDefaultRectForGroup(true),
 	mMinimized(FALSE),
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	mCollapseOnMinimize(false),
+// [/SL:KB]
 	mForeground(FALSE),
 	mFirstLook(TRUE),
 	mButtonScale(1.0f),
@@ -280,6 +309,19 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
 	mMinimizeSignal(NULL)
 //	mNotificationContext(NULL)
 {
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	static bool sShowCollapseInit = false;
+	if (!sShowCollapseInit)
+	{
+		if (LLControlVariable* pControl = LLUI::instance().mSettingGroups["config"]->getControl("ShowFloaterCollapseButton"))
+		{
+			sShowCollapseButton = pControl->getValue().asBoolean();
+			pControl->getSignal()->connect(boost::bind(&LLFloater::handleShowCollapseButtonChanged, _2));
+			sShowCollapseInit = true;
+		}
+	}
+// [/SL:KB]
+
 	mPosition.setFloater(*this);
 //	mNotificationContext = new LLFloaterNotificationContext(getHandle());
 
@@ -318,10 +360,19 @@ void LLFloater::initFloater(const Params& p)
 	mButtonsEnabled[BUTTON_HELP] = FALSE;
 	
 	// Minimize button only for top draggers
-	if ( !mDragOnLeft && mCanMinimize )
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	if (!mDragOnLeft)
 	{
-		mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
+		if (mCanMinimize)
+			mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
+		if (mCanCollapse)
+			mButtonsEnabled[BUTTON_COLLAPSE] = sShowCollapseButton;
 	}
+// [/SL:KB]
+//	if ( !mDragOnLeft && mCanMinimize )
+//	{
+//		mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
+//	}
 
 	if(mCanDock)
 	{
@@ -1236,6 +1287,19 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
 	}
 }
 
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.4
+void LLFloater::setCollapsed(bool collapsed)
+{
+	// (mMinimized == true)  && (collapse == true)  => currently minimized, can not collapse
+	// (mMinimized == false) && (collapse == false) => currently not minimized, can not restore
+	if (isMinimized() == collapsed)
+		return;
+
+	mCollapseOnMinimize = collapsed;
+	setMinimized(collapsed);
+}
+// [/SL:KB]
+
 void LLFloater::setMinimized(BOOL minimize)
 {
 	const LLFloater::Params& default_params = LLFloater::getDefaultParams();
@@ -1258,7 +1322,14 @@ void LLFloater::setMinimized(BOOL minimize)
 		// If the floater has been dragged while minimized in the
 		// past, then locate it at its previous minimized location.
 		// Otherwise, ask the view for a minimize position.
-		if (mHasBeenDraggedWhileMinimized)
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		if (mCollapseOnMinimize)
+		{
+			setOrigin(mExpandedRect.mLeft, mExpandedRect.mTop - floater_header_size);
+		}
+		else if (mHasBeenDraggedWhileMinimized)
+// [/SL:KB]
+//		if (mHasBeenDraggedWhileMinimized)
 		{
 			setOrigin(mPreviousMinimizedLeft, mPreviousMinimizedBottom);
 		}
@@ -1274,6 +1345,13 @@ void LLFloater::setMinimized(BOOL minimize)
 			mButtonsEnabled[BUTTON_MINIMIZE] = FALSE;
 			mButtonsEnabled[BUTTON_RESTORE] = TRUE;
 		}
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		if (mButtonsEnabled[BUTTON_COLLAPSE])
+		{
+			mButtonsEnabled[BUTTON_COLLAPSE] = FALSE;
+			mButtonsEnabled[BUTTON_RESTORE] = TRUE;
+		}
+// [/SL:KB]
 
 		setBorderVisible(TRUE);
 
@@ -1311,23 +1389,45 @@ void LLFloater::setMinimized(BOOL minimize)
 		}
 		
 		// Reshape *after* setting mMinimized
-		reshape( minimized_width, floater_header_size, TRUE);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		reshape( (!mCollapseOnMinimize) ? minimized_width : mExpandedRect.getWidth(), floater_header_size, TRUE);
+// [/SL:KB]
+//		reshape( minimized_width, floater_header_size, TRUE);
 	}
 	else
 	{
 		// If this window has been dragged while minimized (at any time),
 		// remember its position for the next time it's minimized.
-		if (mHasBeenDraggedWhileMinimized)
+//		if (mHasBeenDraggedWhileMinimized)
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		if ( (mHasBeenDraggedWhileMinimized) && (!mCollapseOnMinimize) )
+// [/SL:KB]
 		{
 			const LLRect& currentRect = getRect();
 			mPreviousMinimizedLeft = currentRect.mLeft;
 			mPreviousMinimizedBottom = currentRect.mBottom;
 		}
 
-		setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
+//		setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		// If the floater was moved while collapsed then expand it in-place rather, otherwise snap back to the position it was in when minimized
+		if (mCollapseOnMinimize)
+		{
+			const LLRect& currentRect = getRect();
+			setOrigin(currentRect.mLeft, currentRect.mTop - mExpandedRect.getHeight());
+		}
+		else
+		{
+			setOrigin(mExpandedRect.mLeft, mExpandedRect.mBottom);
+		}
+// [/SL:KB]
 		if (mButtonsEnabled[BUTTON_RESTORE])
 		{
-			mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+			mButtonsEnabled[BUTTON_MINIMIZE] = mCanMinimize;
+			mButtonsEnabled[BUTTON_COLLAPSE] = mCanCollapse && sShowCollapseButton;
+// [/SL:KB]
+//			mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
 			mButtonsEnabled[BUTTON_RESTORE] = FALSE;
 		}
 
@@ -1357,6 +1457,9 @@ void LLFloater::setMinimized(BOOL minimize)
 		}
 		
 		mMinimized = FALSE;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		mCollapseOnMinimize = false;
+// [/SL:KB]
 		setFrontmost();
 		// Reshape *after* setting mMinimized
 		reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
@@ -1648,9 +1751,25 @@ BOOL LLFloater::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
 // virtual
 BOOL LLFloater::handleDoubleClick(S32 x, S32 y, MASK mask)
 {
-	BOOL was_minimized = mMinimized;
-	setMinimized(FALSE);
-	return was_minimized || LLPanel::handleDoubleClick(x, y, mask);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.4
+	// If currently minimized double-click always restores; otherwise, check for double-click in the header area
+	if (mMinimized)
+	{
+		setMinimized(FALSE);
+		return TRUE;
+	}
+	else if ( (mHeaderHeight > 0) && (mDragHandle) && (mButtons[BUTTON_COLLAPSE]) && (mButtons[BUTTON_COLLAPSE]->getVisible()) && (mButtons[BUTTON_COLLAPSE]->getEnabled()) && 
+	          ( ((!mDragOnLeft) && (mDragHandle->getRect().mTop >= y) && (mDragHandle->getRect().mTop - mHeaderHeight <= y)) ||
+	            (mDragOnLeft) && (mDragHandle->getRect().pointInRect(x,y))) )
+	{
+		setCollapsed(true);
+		return TRUE;
+	}
+	return LLPanel::handleDoubleClick(x, y, mask);
+// [/SL:KB]
+//	BOOL was_minimized = mMinimized;
+//	setMinimized(FALSE);
+//	return was_minimized || LLPanel::handleDoubleClick(x, y, mask);
 }
 
 void LLFloater::bringToFront( S32 x, S32 y )
@@ -1758,6 +1877,15 @@ void LLFloater::onClickMinimize(LLFloater* self)
 		return;
 	self->setMinimized( !self->isMinimized() );
 }
+	
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+void LLFloater::onClickCollapse(LLFloater* self)
+{
+	if (!self)
+		return;
+	self->setCollapsed(!self->isMinimized());
+}
+// [/SL:KB]
 
 void LLFloater::onClickTearOff(LLFloater* self)
 {
@@ -1842,6 +1970,18 @@ void LLFloater::initRectControl()
 	}
 }
 
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+void LLFloater::handleShowCollapseButtonChanged(const LLSD& sdValue)
+{
+	sShowCollapseButton = sdValue.asBoolean();
+	for (auto& floater : LLFloater::instance_snapshot())
+	{
+		floater.mButtonsEnabled[BUTTON_COLLAPSE] = (floater.isCollapsible()) && (!floater.mButtonsEnabled[BUTTON_RESTORE]) && (sShowCollapseButton);
+		floater.updateTitleButtons();
+	}
+}
+// [/SL:KB]
+
 // static
 void LLFloater::closeFrontmostFloater()
 {
@@ -2042,6 +2182,19 @@ void	LLFloater::setCanMinimize(BOOL can_minimize)
 	updateTitleButtons();
 }
 
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+void LLFloater::setCanCollapse(bool can_collapse)
+{
+	mCanCollapse = can_collapse;
+	if ( (!can_collapse) && (isMinimized()) && (mCollapseOnMinimize) )
+		setCollapsed(false);
+
+	mButtonsEnabled[BUTTON_COLLAPSE] = can_collapse && !isMinimized() && sShowCollapseButton;
+
+	updateTitleButtons();
+}
+// [/SL:KB]
+
 void	LLFloater::setCanClose(BOOL can_close)
 {
 	mCanClose = can_close;
@@ -2298,6 +2451,10 @@ LLUIImage* LLFloater::getButtonImage(const Params& p, EFloaterButton e)
 			return p.restore_image;
 		case BUTTON_MINIMIZE:
 			return p.minimize_image;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		case BUTTON_COLLAPSE:
+			return p.collapse_image;
+// [/SL:KB]
 		case BUTTON_TEAR_OFF:
 			return p.tear_off_image;
 		case BUTTON_DOCK:
@@ -2319,6 +2476,10 @@ LLUIImage* LLFloater::getButtonPressedImage(const Params& p, EFloaterButton e)
 			return p.restore_pressed_image;
 		case BUTTON_MINIMIZE:
 			return p.minimize_pressed_image;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		case BUTTON_COLLAPSE:
+			return p.collapse_pressed_image;
+// [/SL:KB]
 		case BUTTON_TEAR_OFF:
 			return p.tear_off_pressed_image;
 		case BUTTON_DOCK:
@@ -3247,6 +3408,9 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
 
 	setCanTearOff(p.can_tear_off);
 	setCanMinimize(p.can_minimize);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	setCanCollapse( (p.can_collapse.isProvided()) ? p.can_collapse : p.can_minimize );
+// [/SL:KB]
 	setCanClose(p.can_close);
 	setCanDock(p.can_dock);
 	mResizableWidth = p.can_resize_width;
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 77442d0108cab46a2d6657e9b54d19bd6bd6c8aa..6675edc4590ca500e4a59dde003044ab04906b86 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -139,6 +139,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	{
 		BUTTON_CLOSE = 0,
 		BUTTON_RESTORE,
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+		BUTTON_COLLAPSE,
+// [/SL:KB]
 		BUTTON_MINIMIZE,
 		BUTTON_TEAR_OFF,
 		BUTTON_DOCK,
@@ -158,6 +161,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 								can_resize_height,
 								can_resize_width,
 								can_minimize,
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+								can_collapse,
+// [/SL:KB]
 								can_close,
 								can_drag_on_left,
 								can_tear_off,
@@ -180,12 +186,18 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 		Optional<LLUIImage*>	close_image,
 								restore_image,
 								minimize_image,
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+								collapse_image,
+// [/SL:KB]
 								tear_off_image,
 								dock_image,
 								help_image;
 		Optional<LLUIImage*>	close_pressed_image,
 								restore_pressed_image,
 								minimize_pressed_image,
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+								collapse_pressed_image,
+// [/SL:KB]
 								tear_off_pressed_image,
 								dock_pressed_image,
 								help_pressed_image;
@@ -257,13 +269,19 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	std::string		getTitle() const;
 	void			setShortTitle( const std::string& short_title );
 	std::string		getShortTitle() const;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.4
+	void            setCollapsed(bool collapsed);
+// [/SL:KB]
 	virtual void	setMinimized(BOOL b);
 	void			moveResizeHandlesToFront();
 	void			addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE);
 	void			addDependentFloater(LLHandle<LLFloater> dependent_handle, BOOL reposition = TRUE);
 	LLFloater*		getDependee() { return (LLFloater*)mDependeeHandle.get(); }
 	void		removeDependentFloater(LLFloater* dependent);
-	BOOL			isMinimized() const				{ return mMinimized; }
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	bool			isMinimized() const				{ return mMinimized; }
+// [/SL:KB]
+//	BOOL			isMinimized() const				{ return mMinimized; }
 	/// isShown() differs from getVisible() in that isShown() also considers
 	/// isMinimized(). isShown() is true only if visible and not minimized.
 	bool			isShown() const;
@@ -276,6 +294,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	virtual BOOL	isFrontmost();
 	BOOL			isDependent()					{ return !mDependeeHandle.isDead(); }
 	void			setCanMinimize(BOOL can_minimize);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	void			setCanCollapse(bool can_collapse);
+// [/SL:KB]
 	void			setCanClose(BOOL can_close);
 	void			setCanTearOff(BOOL can_tear_off);
 	virtual void	setCanResize(BOOL can_resize);
@@ -290,6 +311,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	static LLControlGroup*	getControlGroup();
 
 	bool			isMinimizeable() const{ return mCanMinimize; }
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	bool			isCollapsible() const { return mCanCollapse; }
+// [/SL:KB]
 	bool			isCloseable() const{ return mCanClose; }
 	bool			isDragOnLeft() const{ return mDragOnLeft; }
 	S32				getMinWidth() const{ return mMinWidth; }
@@ -359,9 +383,15 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 
 	static void		onClickClose(LLFloater* floater);
 	static void		onClickMinimize(LLFloater* floater);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	static void		onClickCollapse(LLFloater* floater);
+// [/SL:KB]
 	static void		onClickTearOff(LLFloater* floater);
 	static void     onClickDock(LLFloater* floater);
 	static void		onClickHelp(LLFloater* floater);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	static void		handleShowCollapseButtonChanged(const LLSD& sdValue);
+// [/SL:KB]
 
 	static void		setFloaterHost(LLMultiFloater* hostp) {sHostp = hostp; }
 	static LLMultiFloater* getFloaterHost() {return sHostp; }
@@ -486,6 +516,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	
 	BOOL			mCanTearOff;
 	BOOL			mCanMinimize;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	bool			mCanCollapse;
+// [/SL:KB]
 	BOOL			mCanClose;
 	BOOL			mDragOnLeft;
 	BOOL			mResizable;
@@ -502,6 +535,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	S32				mLegacyHeaderHeight;// HACK see initFloaterXML()
 	
 	BOOL			mMinimized;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	bool			mCollapseOnMinimize;
+// [/SL:KB]
 	BOOL			mForeground;
 	LLHandle<LLFloater>	mDependeeHandle;
 	
@@ -529,6 +565,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
 	static std::string	sButtonNames[BUTTON_COUNT];
 	static std::string	sButtonToolTips[BUTTON_COUNT];
 	static std::string  sButtonToolTipsIndex[BUTTON_COUNT];
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-3.2
+	static bool			sShowCollapseButton;
+// [/SL:KB]
 	
 	typedef void(*click_callback)(LLFloater*);
 	static click_callback sButtonCallbacks[BUTTON_COUNT];
diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp
index cd88a0d6b85d7ea1915d32ab3bb1279fe1fa15ef..94f6885a84060924f2ee69e136075b0791895400 100644
--- a/indra/llui/llmultifloater.cpp
+++ b/indra/llui/llmultifloater.cpp
@@ -186,11 +186,17 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
 	floater_data.mWidth = floaterp->getRect().getWidth();
 	floater_data.mHeight = floaterp->getRect().getHeight();
 	floater_data.mCanMinimize = floaterp->isMinimizeable();
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	floater_data.mCanCollapse = floaterp->isCollapsible();
+// [/SL:KB]
 	floater_data.mCanResize = floaterp->isResizable();
     floater_data.mSaveRect = floaterp->mSaveRect;
 
 	// remove minimize and close buttons
 	floaterp->setCanMinimize(FALSE);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	floaterp->setCanCollapse(false);
+// [/SL:KB]
 	floaterp->setCanResize(FALSE);
 	floaterp->setCanDrag(FALSE);
 	floaterp->mSaveRect = FALSE;
@@ -292,6 +298,9 @@ void LLMultiFloater::removeFloater(LLFloater* floaterp)
 	{
 		LLFloaterData& floater_data = found_data_it->second;
 		floaterp->setCanMinimize(floater_data.mCanMinimize);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+		floaterp->setCanCollapse(floater_data.mCanCollapse);
+// [/SL:KB]
 		floaterp->mSaveRect = floater_data.mSaveRect;
 		if (!floater_data.mCanResize)
 		{
diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h
index 62d025298000c5d51b28af31c7984240ba6d6e56..85273e6533161d8e43e14645785c7d1f72209d14 100644
--- a/indra/llui/llmultifloater.h
+++ b/indra/llui/llmultifloater.h
@@ -82,6 +82,9 @@ class LLMultiFloater : public LLFloater
 		S32		    mWidth;
 		S32		    mHeight;
 		BOOL	    mCanMinimize;
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+		bool	    mCanCollapse;
+// [/SL:KB]
 		BOOL	    mCanResize;
 		BOOL        mSaveRect;
 	};
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 7d13e5623f878a1394a1623a8d915ff999c8aa89..6318b77fcb104cb5f1c54fdb7fed72480529ff57 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12702,6 +12702,17 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>ShowFloaterCollapseButton</key>
+    <map>
+      <key>Comment</key>
+      <string>Show/hide the collapse button in the floater controls</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <boolean>1</boolean>
+    </map>
     <key>ShowPGSearchAll</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 6ae04b5a408f9981994bcf4d17f1529ceb9c5ab4..46fd7944d74ef38b4424467d81fa84c621d0e7f3 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -951,6 +951,9 @@ void LLFloaterIMContainer::reshapeFloaterAndSetResizeLimits(bool collapse, S32 d
 
 	setCanResize(at_least_one_panel_is_expanded);
 	setCanMinimize(at_least_one_panel_is_expanded);
+// [SL:KB] - Patch: UI-FloaterCollapse | Checked: Catznip-5.2
+	setCanCollapse(at_least_one_panel_is_expanded);
+// [/SL:KB]
 
     assignResizeLimits();
 }
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 44f626cb1f31d401d677de013634c873a0a41120..6c05665ff0177b434593161eacc9c366a035db95 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -292,6 +292,9 @@ with the same filename but different name
   <texture name="Icon_Minimize_Foreground" file_name="windows/Icon_Minimize_Foreground.png" preload="true" />
   <texture name="Icon_Minimize_Press" file_name="windows/Icon_Minimize_Press.png" preload="true" />
   
+  <texture name="Icon_Collapse_Foreground" file_name="windows/Icon_Collapse_Foreground.png" preload="true" />
+  <texture name="Icon_Collapse_Press" file_name="windows/Icon_Collapse_Press.png" preload="true" />
+
   <texture name="Icon_Paste" file_name="icons/paste_clipboard.png" preload="true" />
 
   <texture name="Icon_Restore_Foreground" file_name="windows/Icon_Restore_Foreground.png" preload="false" />
diff --git a/indra/newview/skins/default/textures/windows/Icon_Collapse_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Collapse_Foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..5c1f99c6588a3b21966bc9baf768c4baa65d7f22
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/Icon_Collapse_Foreground.png differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Collapse_Press.png b/indra/newview/skins/default/textures/windows/Icon_Collapse_Press.png
new file mode 100644
index 0000000000000000000000000000000000000000..076c5a6a625b80f8e669ce57171c0da6ce063cfc
Binary files /dev/null and b/indra/newview/skins/default/textures/windows/Icon_Collapse_Press.png differ
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 86b4ce88f182afddf0679254b846fa749312481e..c08156084436889f824de88c8443d8c9d5877e1e 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -320,6 +320,7 @@ If you feel this is an error, please contact support@secondlife.com</string>
 	<string name="BUTTON_CLOSE_WIN">Close (Ctrl+W)</string>
 	<string name="BUTTON_CLOSE_CHROME">Close</string>
 	<string name="BUTTON_RESTORE">Restore</string>
+	<string name="BUTTON_COLLAPSE">Collapse</string>
 	<string name="BUTTON_MINIMIZE">Minimize</string>
 	<string name="BUTTON_TEAR_OFF">Tear Off</string>
 	<string name="BUTTON_DOCK">Dock</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml
index 807b67d1125f8469fc031be0913e16a83dbf6755..dbc1f6f516062b2680d3c1f2c8591f2ea58fd367 100644
--- a/indra/newview/skins/default/xui/en/widgets/floater.xml
+++ b/indra/newview/skins/default/xui/en/widgets/floater.xml
@@ -13,12 +13,14 @@
  close_image="Icon_Close_Foreground"
  restore_image="Icon_Restore_Foreground"
  minimize_image="Icon_Minimize_Foreground"
+ collapse_image="Icon_Collapse_Foreground"
  tear_off_image="tearoffbox.tga"
  dock_image="Icon_Dock_Foreground"
  help_image="Icon_Help_Foreground"
  close_pressed_image="Icon_Close_Press"
  restore_pressed_image="Icon_Restore_Press"
  minimize_pressed_image="Icon_Minimize_Press"
+ collapse_pressed_image="Icon_Collapse_Press"
  tear_off_pressed_image="tearoff_pressed.tga"
  dock_pressed_image="Icon_Dock_Press"
  help_pressed_image="Icon_Help_Press"