summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popup.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/widgets/popup.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/widgets/popup.cpp')
-rw-r--r--src/gui/widgets/popup.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 978e5b9ca..bf2b2bb83 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -60,17 +60,17 @@ Popup::Popup(const std::string &name,
if (skin.empty())
skin = "popup.xml";
- if (theme)
+ if (theme != nullptr)
{
mSkin = theme->load(skin, "popup.xml");
- if (mSkin)
+ if (mSkin != nullptr)
{
setPadding(mSkin->getPadding());
setPalette(mSkin->getOption("palette"));
}
}
- if (windowContainer)
+ if (windowContainer != nullptr)
windowContainer->add(this);
// Popups are invisible by default
@@ -83,9 +83,9 @@ Popup::~Popup()
delete2(mVertexes);
- if (mSkin)
+ if (mSkin != nullptr)
{
- if (theme)
+ if (theme != nullptr)
theme->unload(mSkin);
mSkin = nullptr;
}
@@ -106,7 +106,7 @@ void Popup::draw(Graphics *const graphics)
{
BLOCK_START("Popup::draw")
- if (mSkin)
+ if (mSkin != nullptr)
{
if (mRedraw)
{
@@ -130,7 +130,7 @@ void Popup::safeDraw(Graphics *const graphics)
{
BLOCK_START("Popup::safeDraw")
- if (mSkin)
+ if (mSkin != nullptr)
{
graphics->drawImageRect(0, 0,
mDimension.width, mDimension.height,
@@ -169,7 +169,7 @@ void Popup::setContentSize(int width, int height)
void Popup::setLocationRelativeTo(const Widget *const widget)
{
- if (!widget)
+ if (widget == nullptr)
return;
int wx, wy;
@@ -187,7 +187,7 @@ void Popup::setLocationRelativeTo(const Widget *const widget)
void Popup::setMinWidth(const int width)
{
- if (mSkin)
+ if (mSkin != nullptr)
{
mMinWidth = width > mSkin->getMinWidth()
? width : mSkin->getMinWidth();
@@ -200,7 +200,7 @@ void Popup::setMinWidth(const int width)
void Popup::setMinHeight(const int height)
{
- if (mSkin)
+ if (mSkin != nullptr)
{
mMinHeight = height > mSkin->getMinHeight() ?
height : mSkin->getMinHeight();
@@ -248,7 +248,7 @@ void Popup::position(const int x, const int y)
void Popup::mouseMoved(MouseEvent &event A_UNUSED)
{
- if (popupManager)
+ if (popupManager != nullptr)
{
popupManager->hideBeingPopup();
popupManager->hideTextPopup();