summaryrefslogtreecommitdiff
path: root/indra/llui/llmenugl.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-05-22 09:58:47 +0000
committerAdam Moss <moss@lindenlab.com>2009-05-22 09:58:47 +0000
commit9dfe0ca9a0228c4fa75c8a3e51840696cc6b4960 (patch)
tree3136e0a32cdcb1d55a4c3a5a67791ca128d947a5 /indra/llui/llmenugl.cpp
parent93cf3d89e51835dd2f61c32b16191ab724528055 (diff)
svn merge -r121194:121210
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.onetwo-merge-1 QAR-1531 viewer 1.23rc1+1.23rc2 merge to trunk
Diffstat (limited to 'indra/llui/llmenugl.cpp')
-rw-r--r--indra/llui/llmenugl.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 5fb0e57c06..0762d7c12d 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -2179,7 +2179,9 @@ void LLMenuGL::arrange( void )
{
if ((*item_iter)->getVisible())
{
- if (!getTornOff() && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width)
+ if (!getTornOff()
+ && item_iter != mItems.begin() // Don't spillover the first item!
+ && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width)
{
// no room for any more items
createSpilloverBranch();
@@ -2189,15 +2191,15 @@ void LLMenuGL::arrange( void )
{
LLMenuItemGL* itemp = (*spillover_iter);
removeChild(itemp);
- mSpilloverMenu->append(itemp);
+ mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning
}
+ mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch
+ mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch
mItems.erase(item_iter, mItems.end());
-
mItems.push_back(mSpilloverBranch);
addChild(mSpilloverBranch);
height = llmax(height, mSpilloverBranch->getNominalHeight());
width += mSpilloverBranch->getNominalWidth();
-
break;
}
else
@@ -2216,7 +2218,9 @@ void LLMenuGL::arrange( void )
{
if ((*item_iter)->getVisible())
{
- if (!getTornOff() && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height)
+ if (!getTornOff()
+ && item_iter != mItems.begin() // Don't spillover the first item!
+ && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height)
{
// no room for any more items
createSpilloverBranch();
@@ -2226,14 +2230,15 @@ void LLMenuGL::arrange( void )
{
LLMenuItemGL* itemp = (*spillover_iter);
removeChild(itemp);
- mSpilloverMenu->append(itemp);
+ mSpilloverMenu->appendNoArrange(itemp); // *NOTE:Mani Favor addChild() in merge with skinning
}
+ mSpilloverMenu->arrange(); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch
+ mSpilloverMenu->updateParent(LLMenuGL::sMenuContainer); // *NOTE: Mani Remove line in merge with skinning/viewer2.0 branch
mItems.erase(item_iter, mItems.end());
mItems.push_back(mSpilloverBranch);
addChild(mSpilloverBranch);
height += mSpilloverBranch->getNominalHeight();
width = llmax( width, mSpilloverBranch->getNominalWidth() );
-
break;
}
else
@@ -2478,6 +2483,15 @@ BOOL LLMenuGL::append( LLMenuItemGL* item )
return TRUE;
}
+// *NOTE:Mani - appendNoArrange() should be removed when merging to skinning/viewer2.0
+// Its added as a fix to a viewer 1.23 bug that has already been address by skinning work.
+BOOL LLMenuGL::appendNoArrange( LLMenuItemGL* item )
+{
+ mItems.push_back( item );
+ addChild( item );
+ return TRUE;
+}
+
// add a separator to this menu
BOOL LLMenuGL::appendSeparator( const std::string &separator_name )
{