summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rwxr-xr-xindra/llui/lltoolbar.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 6bfe113933..ee82e0403b 100755
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -118,7 +118,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
mButtonLeaveSignal(NULL),
mButtonRemoveSignal(NULL),
mDragAndDropTarget(false),
- mCaretIcon(NULL)
+ mCaretIcon(NULL),
+ mCenterPanel(NULL)
{
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
@@ -200,14 +201,15 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
center_panel_p.auto_resize = false;
center_panel_p.user_resize = false;
center_panel_p.mouse_opaque = false;
- LLLayoutPanel* center_panel = LLUICtrlFactory::create<LLLayoutPanel>(center_panel_p);
- mCenteringStack->addChild(center_panel);
+ mCenterPanel = LLUICtrlFactory::create<LLCenterLayoutPanel>(center_panel_p);
+ mCenteringStack->addChild(mCenterPanel);
LLPanel::Params button_panel_p(p.button_panel);
- button_panel_p.rect = center_panel->getLocalRect();
- button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT;
+ button_panel_p.rect = mCenterPanel->getLocalRect();
+ button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT;
mButtonPanel = LLUICtrlFactory::create<LLPanel>(button_panel_p);
- center_panel->addChild(mButtonPanel);
+ mCenterPanel->setButtonPanel(mButtonPanel);
+ mCenterPanel->addChild(mButtonPanel);
mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p));
@@ -928,8 +930,6 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
button_p.label = LLTrans::getString(commandp->labelRef());
button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
button_p.image_overlay = LLUI::getUIImage(commandp->icon());
- button_p.image_hover_unselected = LLUI::getUIImage(commandp->hoverIconUnselected());
- button_p.image_hover_selected = LLUI::getUIImage(commandp->hoverIconSelected());
button_p.button_flash_enable = commandp->isFlashingAllowed();
button_p.overwriteFrom(mButtonParams[mButtonType]);
LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p);
@@ -1244,3 +1244,15 @@ const std::string LLToolBarButton::getToolTip() const
return tooltip;
}
+void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_user)
+{
+ LLLayoutPanel::handleReshape(rect, by_user);
+
+ if (!mReshapeCallback.empty())
+ {
+ LLRect r;
+ localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView);
+ r.stretch(FLOATER_MIN_VISIBLE_PIXELS);
+ mReshapeCallback(mLocationId, r);
+ }
+}