summaryrefslogtreecommitdiff
path: root/indra/llui/lltoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r--indra/llui/lltoolbar.cpp52
1 files changed, 29 insertions, 23 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 785dc85448..2a9bf2585d 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -792,6 +792,11 @@ void LLToolBar::updateLayoutAsNeeded()
mNeedsLayout = false;
}
+bool LLToolBar::postBuild()
+{
+ mCaretIcon = getChild<LLIconCtrl>("caret");
+ return LLUICtrl::postBuild();
+}
void LLToolBar::draw()
{
@@ -835,35 +840,36 @@ void LLToolBar::draw()
LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
// Position the caret
- if (!mCaretIcon)
- {
- mCaretIcon = getChild<LLIconCtrl>("caret");
- }
-
- LLIconCtrl* caret = mCaretIcon;
- caret->setVisible(false);
- if (mDragAndDropTarget && !mButtonCommands.empty())
+ // Todo: This shouldn't be on draw, but, as example, on hover
+ if (mCaretIcon)
{
- LLRect caret_rect = caret->getRect();
- if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)
- {
- caret->setRect(LLRect(mDragx-caret_rect.getWidth()/2+1,
- mDragy,
- mDragx+caret_rect.getWidth()/2+1,
- mDragy-mDragGirth));
- }
- else
+ mCaretIcon->setVisible(false);
+ if (mDragAndDropTarget && !mButtonCommands.empty())
{
- caret->setRect(LLRect(mDragx,
- mDragy+caret_rect.getHeight()/2,
- mDragx+mDragGirth,
- mDragy-caret_rect.getHeight()/2));
+ LLRect caret_rect = mCaretIcon->getRect();
+ if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)
+ {
+ mCaretIcon->setRect(LLRect(mDragx - caret_rect.getWidth() / 2 + 1,
+ mDragy,
+ mDragx + caret_rect.getWidth() / 2 + 1,
+ mDragy - mDragGirth));
+ }
+ else
+ {
+ mCaretIcon->setRect(LLRect(mDragx,
+ mDragy + caret_rect.getHeight() / 2,
+ mDragx + mDragGirth,
+ mDragy - caret_rect.getHeight() / 2));
+ }
+ mCaretIcon->setVisible(true);
}
- caret->setVisible(true);
}
LLUICtrl::draw();
- caret->setVisible(false);
+ if (mCaretIcon)
+ {
+ mCaretIcon->setVisible(false);
+ }
mDragAndDropTarget = false;
}