summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.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/window.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 02a13a249..450c2e025 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -202,7 +202,7 @@ Window::Window(const std::string &caption,
{
mCaptionAlign = Graphics::LEFT;
}
- setTitleBarHeight(static_cast<unsigned int>(
+ setTitleBarHeight(CAST_U32(
getOption("titlebarHeight")));
if (!mTitleBarHeight)
mTitleBarHeight = mCaptionFont->getHeight() + mPadding;
@@ -821,7 +821,7 @@ void Window::mousePressed(MouseEvent &event)
mDragOffsetX = event.getX();
mDragOffsetY = event.getY();
- mMoved = event.getY() <= static_cast<int>(mTitleBarHeight);
+ mMoved = event.getY() <= CAST_S32(mTitleBarHeight);
}
const MouseButtonT button = event.getButton();
@@ -1290,8 +1290,8 @@ int Window::getResizeHandles(const MouseEvent &event)
{
if (mGrip &&
(y > mTitleBarHeight ||
- (static_cast<int>(y) < mPadding &&
- static_cast<int>(mTitleBarHeight) > mPadding)))
+ (CAST_S32(y) < mPadding &&
+ CAST_S32(mTitleBarHeight) > mPadding)))
{
if (!getWindowArea().isPointInRect(x, y)
&& event.getSource() == this)
@@ -1301,8 +1301,8 @@ int Window::getResizeHandles(const MouseEvent &event)
resizeHandles |= (y > mDimension.height - resizeBorderWidth)
? BOTTOM : (y < resizeBorderWidth) ? TOP : 0;
}
- if (x >= static_cast<unsigned>(mGripRect.x)
- && y >= static_cast<unsigned>(mGripRect.y))
+ if (x >= CAST_U32(mGripRect.x)
+ && y >= CAST_U32(mGripRect.y))
{
mDragOffsetX = x;
mDragOffsetY = y;
@@ -1319,7 +1319,7 @@ bool Window::isResizeAllowed(const MouseEvent &event) const
const int y = event.getY();
if (mGrip &&
- (y > static_cast<int>(mTitleBarHeight) ||
+ (y > CAST_S32(mTitleBarHeight) ||
y < mPadding))
{
const int x = event.getX();