summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorskolb <none@none>2009-12-03 09:18:11 -0800
committerskolb <none@none>2009-12-03 09:18:11 -0800
commit7851819c88e8049c1c3d07d279d479c53d5de777 (patch)
treee8c81e110a71427b64e0b34f4351e7acf44465f3 /indra/llui
parent9b17e6710b713fa12f6db7d6f51d97e4052a0835 (diff)
parent57b68d9bfe25fc7b9efe41a9fa30935c156acb34 (diff)
local merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp2
-rw-r--r--indra/llui/llfloater.h2
-rw-r--r--indra/llui/llmenugl.cpp9
-rw-r--r--indra/llui/llscrollcontainer.cpp21
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();
}