summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.cpp
diff options
context:
space:
mode:
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;