summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
commit1e2a88e975019929c4c7e3154537865cc09550a6 (patch)
treeae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/widgets/button.cpp
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadmanaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r--src/gui/widgets/button.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 1f51d8ba9..44e41be5a 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -805,12 +805,16 @@ void Button::adjustSize()
if (mImages != nullptr)
{
- const int spacing = mSpacing[BUTTON_STANDARD];
const int width = font->getWidth(mCaption);
if (width != 0)
+ {
+ const int spacing = mSpacing[BUTTON_STANDARD];
setWidth(width + mImageWidth + spacing + 2 * padding);
+ }
else
+ {
setWidth(mImageWidth + 2 * padding);
+ }
int height = font->getHeight();
if (height < mImageHeight)
height = mImageHeight;