diff options
author | Richard Nelson <richard@lindenlab.com> | 2011-09-26 17:36:07 -0700 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2011-09-26 17:36:07 -0700 |
commit | a465f816b8e7674aa3f22023d7708106ca35b350 (patch) | |
tree | a9c767df415ba156b7528a27ffb06402002e08db /indra/llui/lltoolbar.cpp | |
parent | 16fead6429eba35bdfb8ef01610780a508e062df (diff) |
EXP-1239 FIX make toolbars wrap when there is not enough room
toolbars resize to fit buttons
toolbar view uses layout stacks to organize toolbars
reviewed by Leslie
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 31a18dc707..90ade136e8 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -122,6 +122,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) centering_stack_p.rect = getLocalRect(); centering_stack_p.follows.flags = FOLLOWS_ALL; centering_stack_p.orientation = orientation; + centering_stack_p.mouse_opaque = false; mCenteringStack = LLUICtrlFactory::create<LLLayoutStack>(centering_stack_p); addChild(mCenteringStack); @@ -131,6 +132,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) border_panel_p.rect = getLocalRect(); border_panel_p.auto_resize = true; border_panel_p.user_resize = false; + border_panel_p.mouse_opaque = false; mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); @@ -145,21 +147,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) LLPanel::Params button_panel_p(p.button_panel); button_panel_p.rect = center_panel->getLocalRect(); - switch(p.side()) - { - case SIDE_LEFT: - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; - break; - case SIDE_RIGHT: - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_RIGHT; - break; - case SIDE_TOP: - button_panel_p.follows.flags = FOLLOWS_TOP|FOLLOWS_LEFT; - break; - case SIDE_BOTTOM: - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; - break; - } + button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; mButtonPanel = LLUICtrlFactory::create<LLPanel>(button_panel_p); center_panel->addChild(mButtonPanel); @@ -329,19 +317,22 @@ void LLToolBar::updateLayoutAsNeeded() { if (mSideType == SIDE_TOP) { // shift down to maintain top edge - mButtonPanel->translate(0, mButtonPanel->getRect().getHeight() - total_girth); + translate(0, getRect().getHeight() - total_girth); } + reshape(getRect().getWidth(), total_girth); mButtonPanel->reshape(max_row_length, total_girth); } else // VERTICAL { if (mSideType == SIDE_RIGHT) { // shift left to maintain right edge - mButtonPanel->translate(mButtonPanel->getRect().getWidth() - total_girth, 0); + translate(getRect().getWidth() - total_girth, 0); } + + reshape(total_girth, getRect().getHeight()); mButtonPanel->reshape(total_girth, max_row_length); - } + } // re-center toolbar buttons mCenteringStack->updateLayout(); |