From 1e2a88e975019929c4c7e3154537865cc09550a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Feb 2020 09:30:51 +0300 Subject: Fix some code style issues --- src/gui/widgets/button.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/button.cpp') 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; -- cgit v1.2.3-70-g09d2