From fd03ae299bfaf83789e511912d99d204c0833e7f Mon Sep 17 00:00:00 2001
From: Leyla Farazha <leyla@lindenlab.com>
Date: Mon, 10 Oct 2011 17:08:51 -0700
Subject: EXP-1274 Create floater for "Avatar Picker" content EXP-1299 Nearby
 Voice floater can't be closed by clicking the sidebar button again. EXP-1306
 Prompt text to "Change your avatar" and "Destinations" floaters get pushed
 down one line when the floater dialog gets resized to minimum width

---
 indra/llui/llfloater.cpp      | 21 +++++++++++++++------
 indra/llui/llfloater.h        |  2 +-
 indra/llui/llresizehandle.cpp | 12 ------------
 indra/llui/llresizehandle.h   |  7 +------
 4 files changed, 17 insertions(+), 25 deletions(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c28bcc2ec9..f85e46e28d 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -459,15 +459,24 @@ void LLFloater::layoutResizeCtrls()
 	mResizeHandle[3]->setRect(rect);
 }
 
-void LLFloater::enableResizeCtrls(bool enable)
+void LLFloater::enableResizeCtrls(bool enable, bool width, bool height)
 {
+	mResizeBar[LLResizeBar::LEFT]->setVisible(enable && width);
+	mResizeBar[LLResizeBar::LEFT]->setEnabled(enable && width);
+
+	mResizeBar[LLResizeBar::TOP]->setVisible(enable && height);
+	mResizeBar[LLResizeBar::TOP]->setEnabled(enable && height);
+	
+	mResizeBar[LLResizeBar::RIGHT]->setVisible(enable && width);
+	mResizeBar[LLResizeBar::RIGHT]->setEnabled(enable && width);
+	
+	mResizeBar[LLResizeBar::BOTTOM]->setVisible(enable && height);
+	mResizeBar[LLResizeBar::BOTTOM]->setEnabled(enable && height);
+
 	for (S32 i = 0; i < 4; ++i)
 	{
-		mResizeBar[i]->setVisible(enable);
-		mResizeBar[i]->setEnabled(enable);
-
-		mResizeHandle[i]->setVisible(enable);
-		mResizeHandle[i]->setEnabled(enable);
+		mResizeHandle[i]->setVisible(enable && width && height);
+		mResizeHandle[i]->setEnabled(enable && width && height);
 	}
 }
 
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 5aff542049..af9665e599 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -291,6 +291,7 @@ public:
 
 	void			updateTransparency(ETypeTransparency transparency_type);
 		
+	void			enableResizeCtrls(bool enable, bool width = true, bool height = true);
 protected:
 	virtual void    applySavedVariables();
 
@@ -340,7 +341,6 @@ private:
 	BOOL			offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index);
 	void			addResizeCtrls();
 	void			layoutResizeCtrls();
-	void			enableResizeCtrls(bool enable);
 	void 			addDragHandle();
 	void			layoutDragHandle();		// repair layout
 
diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp
index 942e84eeb6..c3a51c36c9 100644
--- a/indra/llui/llresizehandle.cpp
+++ b/indra/llui/llresizehandle.cpp
@@ -55,8 +55,6 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p)
 	mImage( NULL ),
 	mMinWidth( p.min_width ),
 	mMinHeight( p.min_height ),
-	mMaxWidth(S32_MAX),
-	mMaxHeight(S32_MAX),
 	mCorner( p.corner )
 {
 	if( RIGHT_BOTTOM == mCorner)
@@ -179,11 +177,6 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
 				new_width = mMinWidth;
 				delta_x = x_multiple * (mMinWidth - orig_rect.getWidth());
 			}
-			else if (new_width > mMaxWidth)
-			{
-				new_width = mMaxWidth;
-				delta_x = x_multiple * (mMaxWidth - orig_rect.getWidth());
-			}
 
 			S32 new_height = orig_rect.getHeight() + y_multiple * delta_y;
 			if( new_height < mMinHeight )
@@ -191,11 +184,6 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask)
 				new_height = mMinHeight;
 				delta_y = y_multiple * (mMinHeight - orig_rect.getHeight());
 			}
-			else if (new_height > mMaxHeight)
-			{
-				new_height = mMaxHeight;
-				delta_y = y_multiple * (mMaxHeight - orig_rect.getHeight());
-			}
 
 			switch( mCorner )
 			{
diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h
index 5cfe3fb63c..7541b9e6c0 100644
--- a/indra/llui/llresizehandle.h
+++ b/indra/llui/llresizehandle.h
@@ -55,10 +55,7 @@ public:
 	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);
 
 	void			setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; }
-
-	void			setMaxWidth(S32 width) { mMaxWidth = width;}
-	void			setMaxHeight(S32 height) { mMaxHeight = height;}
-
+	
 private:
 	BOOL			pointInHandle( S32 x, S32 y );
 
@@ -69,9 +66,7 @@ private:
 	LLCoordGL		mLastMouseDir;
 	LLPointer<LLUIImage>	mImage;
 	S32				mMinWidth;
-	S32				mMaxWidth;
 	S32				mMinHeight;
-	S32				mMaxHeight;
 	const ECorner	mCorner;
 };
 
-- 
cgit v1.2.3


From 6a570a9bdc2660e4db87e8e7a65b724e1ad8d1b2 Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Mon, 10 Oct 2011 17:52:37 -0700
Subject: fixed icons moving when clicking on icon-only toolbars

---
 indra/llui/llbutton.cpp  | 2 +-
 indra/llui/lltoolbar.cpp | 5 +++++
 indra/llui/lltoolbar.h   | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 68cb5164b6..ba3748a573 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -1002,7 +1002,7 @@ void LLButton::resize(LLUIString label)
 		if (mImageOverlay)
 		{
 			S32 overlay_width = mImageOverlay->getWidth();
-			F32 scale_factor = getRect().getHeight() / (F32)mImageOverlay->getHeight();
+			F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
 			overlay_width = llround((F32)overlay_width * scale_factor);
 
 			switch(mImageOverlayAlignment)
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 6332b2674a..5ba54edf1c 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -852,3 +852,8 @@ void LLToolBarButton::onMouseCaptureLost()
 {
 	mIsDragged = false;
 }
+
+void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+	LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent);
+}
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 84fa7ec0df..a81a5fdb39 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -62,6 +62,8 @@ public:
 
 	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
 	BOOL handleHover(S32 x, S32 y, MASK mask);
+	void reshape(S32 width, S32 height, BOOL called_from_parent = true);
+
 	void setCommandId(const LLCommandId& id) { mId = id; }
 
 	void setStartDragCallback(tool_startdrag_callback_t cb)   { mStartDragItemCallback  = cb; }
-- 
cgit v1.2.3