summaryrefslogtreecommitdiff
path: root/src/gui/widgets/listbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/widgets/listbox.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
manaverse-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r--src/gui/widgets/listbox.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index c827911eb..ced9dcb99 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -122,7 +122,7 @@ ListBox::ListBox(const Widget2 *const widget,
}
const Font *const font = getFont();
- mRowHeight = static_cast<unsigned int>(
+ mRowHeight = CAST_U32(
font->getHeight() + 2 * mItemPadding);
}
@@ -157,10 +157,10 @@ void ListBox::draw(Graphics *graphics)
BLOCK_START("ListBox::draw")
updateAlpha();
- mHighlightColor.a = static_cast<unsigned int>(mAlpha * 255.0F);
+ mHighlightColor.a = CAST_U32(mAlpha * 255.0F);
graphics->setColor(mHighlightColor);
Font *const font = getFont();
- const int rowHeight = static_cast<int>(getRowHeight());
+ const int rowHeight = CAST_S32(getRowHeight());
const int width = mDimension.width;
if (mCenterText)
@@ -359,7 +359,7 @@ void ListBox::adjustSize()
BLOCK_START("ListBox::adjustSize")
if (mListModel)
{
- setHeight(static_cast<int>(getRowHeight()) *
+ setHeight(CAST_S32(getRowHeight()) *
mListModel->getNumberOfElements() + 2 * mPadding);
}
BLOCK_END("ListBox::adjustSize")
@@ -376,7 +376,7 @@ int ListBox::getSelectionByMouse(const int y) const
{
if (y < mPadding)
return -1;
- return (y - mPadding) / static_cast<int>(getRowHeight());
+ return (y - mPadding) / CAST_S32(getRowHeight());
}
void ListBox::setSelected(const int selected)
@@ -400,9 +400,9 @@ void ListBox::setSelected(const int selected)
if (mSelected < 0)
scroll.y = 0;
else
- scroll.y = static_cast<int>(getRowHeight()) * mSelected;
+ scroll.y = CAST_S32(getRowHeight()) * mSelected;
- scroll.height = static_cast<int>(getRowHeight());
+ scroll.height = CAST_S32(getRowHeight());
showPart(scroll);
distributeValueChangedEvent();