summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelemojicomplete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelemojicomplete.cpp')
-rw-r--r--indra/newview/llpanelemojicomplete.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/llpanelemojicomplete.cpp b/indra/newview/llpanelemojicomplete.cpp
index e6e3a10e13..3faa01ae0c 100644
--- a/indra/newview/llpanelemojicomplete.cpp
+++ b/indra/newview/llpanelemojicomplete.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llpanelemojicomplete.h
* @brief Header file for LLPanelEmojiComplete
*
@@ -94,13 +94,13 @@ void LLPanelEmojiComplete::draw()
if (mVertical)
{
x = mRenderRect.mLeft;
- y = mRenderRect.mTop - (mCurSelected - firstVisibleIdx + 1) * mEmojiHeight;
+ y = mRenderRect.mTop - static_cast<S32>(mCurSelected - firstVisibleIdx + 1) * mEmojiHeight;
width = mRenderRect.getWidth();
height = mEmojiHeight;
}
else
{
- x = mRenderRect.mLeft + (mCurSelected - firstVisibleIdx) * mEmojiWidth;
+ x = mRenderRect.mLeft + static_cast<S32>(mCurSelected - firstVisibleIdx) * mEmojiWidth;
y = mRenderRect.mBottom;
width = mEmojiWidth;
height = mRenderRect.getHeight();
@@ -113,7 +113,7 @@ void LLPanelEmojiComplete::draw()
F32 textLeft = mVertical ? mRenderRect.mLeft + mEmojiWidth + mPadding : 0;
F32 textWidth = mVertical ? getRect().getWidth() - textLeft - mPadding : 0;
- for (U32 curIdx = firstVisibleIdx; curIdx < lastVisibleIdx; curIdx++)
+ for (size_t curIdx = firstVisibleIdx; curIdx < lastVisibleIdx; curIdx++)
{
LLWString text(1, mEmojis[curIdx].Character);
mIconFont->render(text, 0, iconCenterX, iconCenterY,
@@ -129,7 +129,7 @@ void LLPanelEmojiComplete::draw()
std::string text = shortCode.substr(0, mEmojis[curIdx].Begin);
mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::white,
LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
- text.size(), x1);
+ static_cast<S32>(text.size()), x1);
x0 += mTextFont->getWidthF32(text);
x1 = textLeft + textWidth - x0;
}
@@ -138,7 +138,7 @@ void LLPanelEmojiComplete::draw()
std::string text = shortCode.substr(mEmojis[curIdx].Begin, mEmojis[curIdx].End - mEmojis[curIdx].Begin);
mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::yellow6,
LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
- text.size(), x1);
+ static_cast<S32>(text.size()), x1);
x0 += mTextFont->getWidthF32(text);
x1 = textLeft + textWidth - x0;
}
@@ -147,7 +147,7 @@ void LLPanelEmojiComplete::draw()
std::string text = shortCode.substr(mEmojis[curIdx].End);
mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::white,
LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
- text.size(), x1);
+ static_cast<S32>(text.size()), x1);
}
iconCenterY -= mEmojiHeight;
}
@@ -158,10 +158,10 @@ void LLPanelEmojiComplete::draw()
}
}
-BOOL LLPanelEmojiComplete::handleHover(S32 x, S32 y, MASK mask)
+bool LLPanelEmojiComplete::handleHover(S32 x, S32 y, MASK mask)
{
if (mScrollbar && mScrollbar->getVisible() && childrenHandleHover(x, y, mask))
- return TRUE;
+ return true;
LLVector2 curHover(x, y);
if ((mLastHover - curHover).lengthSquared() > MIN_MOUSE_MOVE_DELTA)
@@ -172,10 +172,10 @@ BOOL LLPanelEmojiComplete::handleHover(S32 x, S32 y, MASK mask)
mLastHover = curHover;
}
- return TRUE;
+ return true;
}
-BOOL LLPanelEmojiComplete::handleKey(KEY key, MASK mask, BOOL called_from_parent)
+bool LLPanelEmojiComplete::handleKey(KEY key, MASK mask, bool called_from_parent)
{
bool handled = false;
if (mTotalEmojis && MASK_NONE == mask)
@@ -223,43 +223,43 @@ BOOL LLPanelEmojiComplete::handleKey(KEY key, MASK mask, BOOL called_from_parent
if (handled)
{
- return TRUE;
+ return true;
}
return LLUICtrl::handleKey(key, mask, called_from_parent);
}
-BOOL LLPanelEmojiComplete::handleMouseDown(S32 x, S32 y, MASK mask)
+bool LLPanelEmojiComplete::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (mScrollbar && mScrollbar->getVisible() && childrenHandleMouseDown(x, y, mask))
- return TRUE;
+ return true;
mCurSelected = posToIndex(x, y);
mLastHover = LLVector2(x, y);
- return TRUE;
+ return true;
}
-BOOL LLPanelEmojiComplete::handleMouseUp(S32 x, S32 y, MASK mask)
+bool LLPanelEmojiComplete::handleMouseUp(S32 x, S32 y, MASK mask)
{
if (mScrollbar && mScrollbar->getVisible() && childrenHandleMouseUp(x, y, mask))
- return TRUE;
+ return true;
mCurSelected = posToIndex(x, y);
onCommit();
- return TRUE;
+ return true;
}
-BOOL LLPanelEmojiComplete::handleScrollWheel(S32 x, S32 y, S32 clicks)
+bool LLPanelEmojiComplete::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
if (mNoScroll)
- return FALSE;
+ return false;
if (mScrollbar && mScrollbar->getVisible() && mScrollbar->handleScrollWheel(x, y, clicks))
{
mCurSelected = posToIndex(x, y);
- return TRUE;
+ return true;
}
if (mTotalEmojis > mVisibleEmojis)
@@ -270,10 +270,10 @@ BOOL LLPanelEmojiComplete::handleScrollWheel(S32 x, S32 y, S32 clicks)
S32 newScrollPos = llmax(0, (S32)mScrollPos + clicks);
mScrollPos = llclamp<size_t>((size_t)newScrollPos, 0, mTotalEmojis - mVisibleEmojis);
mCurSelected = posToIndex(x, y);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLPanelEmojiComplete::onCommit()
@@ -286,7 +286,7 @@ void LLPanelEmojiComplete::onCommit()
}
}
-void LLPanelEmojiComplete::reshape(S32 width, S32 height, BOOL called_from_parent)
+void LLPanelEmojiComplete::reshape(S32 width, S32 height, bool called_from_parent)
{
LLUICtrl::reshape(width, height, called_from_parent);
if (mAutoSize)
@@ -349,7 +349,7 @@ U32 LLPanelEmojiComplete::getMaxShortCodeWidth() const
U32 max_width = 0;
for (const LLEmojiSearchResult& result : mEmojis)
{
- S32 width = mTextFont->getWidth(result.String);
+ U32 width = mTextFont->getWidth(result.String);
if (width > max_width)
{
max_width = width;
@@ -373,11 +373,11 @@ void LLPanelEmojiComplete::onEmojisChanged()
{
width += mScrollbar->getThickness();
}
- height = mVisibleEmojis * mEmojiHeight;
+ height = static_cast<S32>(mVisibleEmojis) * mEmojiHeight;
}
else
{
- width = mVisibleEmojis * mEmojiWidth;
+ width = static_cast<S32>(mVisibleEmojis) * mEmojiWidth;
height = getRect().getHeight();
}
LLUICtrl::reshape(width, height, false);
@@ -445,21 +445,21 @@ void LLPanelEmojiComplete::updateConstraints()
if (!mNoScroll && mVisibleEmojis < mTotalEmojis)
{
mRenderRect.mRight -= mScrollbar->getThickness();
- mScrollbar->setDocSize(mTotalEmojis);
- mScrollbar->setPageSize(mVisibleEmojis);
+ mScrollbar->setDocSize(static_cast<S32>(mTotalEmojis));
+ mScrollbar->setPageSize(static_cast<S32>(mVisibleEmojis));
mScrollbar->setOrigin(mRenderRect.mRight, 0);
- mScrollbar->reshape(mScrollbar->getThickness(), mRenderRect.mTop, TRUE);
- mScrollbar->setVisible(TRUE);
+ mScrollbar->reshape(mScrollbar->getThickness(), mRenderRect.mTop, true);
+ mScrollbar->setVisible(true);
}
else
{
- mScrollbar->setVisible(FALSE);
+ mScrollbar->setVisible(false);
}
}
else
{
mEmojiHeight = mRenderRect.getHeight();
- mRenderRect.stretch((mRenderRect.getWidth() - mVisibleEmojis * mEmojiWidth) / -2, 0);
+ mRenderRect.stretch((mRenderRect.getWidth() - static_cast<S32>(mVisibleEmojis) * mEmojiWidth) / -2, 0);
}
updateScrollPos();
@@ -486,7 +486,7 @@ void LLPanelEmojiComplete::updateScrollPos()
if (mScrollbar && mScrollbar->getVisible())
{
- mScrollbar->setDocPos(mScrollPos);
+ mScrollbar->setDocPos(static_cast<S32>(mScrollPos));
}
}
@@ -504,7 +504,7 @@ LLFloaterEmojiComplete::LLFloaterEmojiComplete(const LLSD& sdKey)
setIsChrome(true);
}
-BOOL LLFloaterEmojiComplete::handleKey(KEY key, MASK mask, BOOL called_from_parent)
+bool LLFloaterEmojiComplete::handleKey(KEY key, MASK mask, bool called_from_parent)
{
bool handled = false;
if (MASK_NONE == mask)
@@ -519,7 +519,7 @@ BOOL LLFloaterEmojiComplete::handleKey(KEY key, MASK mask, BOOL called_from_pare
}
if (handled)
- return TRUE;
+ return true;
return LLFloater::handleKey(key, mask, called_from_parent);
}
@@ -542,10 +542,10 @@ void LLFloaterEmojiComplete::onOpen(const LLSD& key)
setRect(outer_rect);
}
- gFloaterView->adjustToFitScreen(this, FALSE);
+ gFloaterView->adjustToFitScreen(this, false);
}
-BOOL LLFloaterEmojiComplete::postBuild()
+bool LLFloaterEmojiComplete::postBuild()
{
mEmojiCtrl = findChild<LLPanelEmojiComplete>("emoji_complete_ctrl");
mEmojiCtrl->setCommitCallback(
@@ -561,7 +561,7 @@ BOOL LLFloaterEmojiComplete::postBuild()
return LLFloater::postBuild();
}
-void LLFloaterEmojiComplete::reshape(S32 width, S32 height, BOOL called_from_parent)
+void LLFloaterEmojiComplete::reshape(S32 width, S32 height, bool called_from_parent)
{
if (called_from_parent)
{