diff options
| author | Loren Shih <seraph@lindenlab.com> | 2009-12-03 15:41:36 -0500 | 
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2009-12-03 15:41:36 -0500 | 
| commit | 1ffd7c99afe25da37a83a2a1dd8a03c7275a5f6b (patch) | |
| tree | ad40ea009c5ebea67dd5334d210d90b6dbeebbd3 /indra/llui | |
| parent | 202d86b15567a783bed55849a7cdc8ad8d8f874f (diff) | |
| parent | a9609ae1557a70e095088e0a9b6ef5564dfdb388 (diff) | |
automated merge for avp->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llfloater.cpp | 2 | ||||
| -rw-r--r-- | indra/llui/llfloater.h | 2 | ||||
| -rw-r--r-- | indra/llui/llmenugl.cpp | 9 | ||||
| -rw-r--r-- | indra/llui/llscrollcontainer.cpp | 21 | 
4 files changed, 21 insertions, 13 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 36a9e0a650..a63187678e 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1452,6 +1452,7 @@ void LLFloater::onClickTearOff(LLFloater* self)  		gFloaterView->adjustToFitScreen(self, FALSE);  		// give focus to new window to keep continuity for the user  		self->setFocus(TRUE); +		self->setTornOff(true);  	}  	else  //Attach to parent.  	{ @@ -1463,6 +1464,7 @@ void LLFloater::onClickTearOff(LLFloater* self)  			// make sure host is visible  			new_host->openFloater(new_host->getKey());  		} +		self->setTornOff(false);  	}  } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index d7ec0aac00..b5c835cb47 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -259,6 +259,8 @@ public:  	bool            isDocked() const { return mDocked; }  	virtual void    setDocked(bool docked, bool pop_on_undock = true); +	virtual void    setTornOff(bool torn_off) {} +  	// Return a closeable floater, if any, given the current focus.  	static LLFloater* getClosableFloaterFromFocus();  diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index f8935d03ac..907f2352a0 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -590,12 +590,13 @@ BOOL LLMenuItemSeparatorGL::handleMouseDown(S32 x, S32 y, MASK mask)  	LLMenuGL* parent_menu = getMenu();  	if (y > getRect().getHeight() / 2)  	{ -		LLView* prev_menu_item = parent_menu->findPrevSibling(this); +		// the menu items are in the child list in bottom up order +		LLView* prev_menu_item = parent_menu->findNextSibling(this);  		return prev_menu_item ? prev_menu_item->handleMouseDown(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;  	}  	else  	{ -		LLView* next_menu_item = parent_menu->findNextSibling(this); +		LLView* next_menu_item = parent_menu->findPrevSibling(this);  		return next_menu_item ? next_menu_item->handleMouseDown(x, 0, mask) : FALSE;  	}  } @@ -605,12 +606,12 @@ BOOL LLMenuItemSeparatorGL::handleMouseUp(S32 x, S32 y, MASK mask)  	LLMenuGL* parent_menu = getMenu();  	if (y > getRect().getHeight() / 2)  	{ -		LLView* prev_menu_item = parent_menu->findPrevSibling(this); +		LLView* prev_menu_item = parent_menu->findNextSibling(this);  		return prev_menu_item ? prev_menu_item->handleMouseUp(x, prev_menu_item->getRect().getHeight(), mask) : FALSE;  	}  	else  	{ -		LLView* next_menu_item = parent_menu->findNextSibling(this); +		LLView* next_menu_item = parent_menu->findPrevSibling(this);  		return next_menu_item ? next_menu_item->handleMouseUp(x, 0, mask) : FALSE;  	}  } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 53c5a8d07d..f6caed4617 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -111,7 +111,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)  	LLView::addChild( mBorder );  	mInnerRect.set( 0, getRect().getHeight(), getRect().getWidth(), 0 ); -	mInnerRect.stretch( -mBorder->getBorderWidth()  ); +	mInnerRect.stretch( -getBorderWidth()  );  	LLRect vertical_scroll_rect = mInnerRect;  	vertical_scroll_rect.mLeft = vertical_scroll_rect.mRight - scrollbar_size; @@ -189,7 +189,7 @@ void LLScrollContainer::reshape(S32 width, S32 height,  	LLUICtrl::reshape( width, height, called_from_parent );  	mInnerRect = getLocalRect(); -	mInnerRect.stretch( -mBorder->getBorderWidth() ); +	mInnerRect.stretch( -getBorderWidth() );  	if (mScrolledView)  	{ @@ -351,9 +351,9 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height  	S32 doc_width = doc_rect.getWidth();  	S32 doc_height = doc_rect.getHeight(); -	S32 border_width = (mBorder->getVisible() ? 2 * mBorder->getBorderWidth() : 0); -	*visible_width = getRect().getWidth() - border_width; -	*visible_height = getRect().getHeight() - border_width; +	S32 border_width = getBorderWidth(); +	*visible_width = getRect().getWidth() - 2 * border_width; +	*visible_height = getRect().getHeight() - 2 * border_width;  	*show_v_scrollbar = FALSE;  	*show_h_scrollbar = FALSE; @@ -499,7 +499,7 @@ void LLScrollContainer::updateScroll()  	BOOL show_h_scrollbar = FALSE;  	calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); -	S32 border_width = mBorder->getBorderWidth(); +	S32 border_width = getBorderWidth();  	if( show_v_scrollbar )  	{  		if( doc_rect.mTop < getRect().getHeight() - border_width ) @@ -573,6 +573,9 @@ void LLScrollContainer::updateScroll()  void LLScrollContainer::setBorderVisible(BOOL b)  {  	mBorder->setVisible( b ); +	// Recompute inner rect, as border visibility changes it +	mInnerRect = getLocalRect(); +	mInnerRect.stretch( -getBorderWidth() );  }  LLRect LLScrollContainer::getVisibleContentRect() @@ -593,7 +596,7 @@ LLRect LLScrollContainer::getContentWindowRect()  	BOOL show_h_scrollbar = FALSE;  	BOOL show_v_scrollbar = FALSE;  	calcVisibleSize( &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); -	S32 border_width = mBorder->getVisible() ? mBorder->getBorderWidth() : 0; +	S32 border_width = getBorderWidth();  	scroller_view_rect.setOriginAndSize(border_width,   										show_h_scrollbar ? mScrollbar[HORIZONTAL]->getRect().mTop : border_width,   										visible_width,  @@ -626,7 +629,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const  								rect_to_constrain.mTop - constraint.mTop);  	// translate from allowable region for lower left corner to upper left corner -	allowable_scroll_rect.translate(0, content_window_rect.getHeight() - 1); +	allowable_scroll_rect.translate(0, content_window_rect.getHeight());  	S32 vert_pos = llclamp(mScrollbar[VERTICAL]->getDocPos(),   					mScrollbar[VERTICAL]->getDocSize() - allowable_scroll_rect.mTop, // min vertical scroll @@ -674,7 +677,7 @@ void LLScrollContainer::goToBottom()  S32 LLScrollContainer::getBorderWidth() const  { -	if (mBorder) +	if (mBorder->getVisible())  	{  		return mBorder->getBorderWidth();  	}  | 
