diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
commit | 1e2a88e975019929c4c7e3154537865cc09550a6 (patch) | |
tree | ae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/widgets/dropdown.cpp | |
parent | 6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff) | |
download | mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2 mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz mv-1e2a88e975019929c4c7e3154537865cc09550a6.zip |
Fix some code style issues
Diffstat (limited to 'src/gui/widgets/dropdown.cpp')
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 1d09d5c97..f4fb56f9e 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -226,7 +226,6 @@ void DropDown::draw(Graphics *const graphics) updateAlpha(); const unsigned int alpha = CAST_U32(mAlpha * 255.0F); - const int pad = 2 * mPadding; mHighlightColor.a = alpha; mShadowColor.a = alpha; @@ -272,6 +271,7 @@ void DropDown::draw(Graphics *const graphics) if (isFocused()) { + const int pad = 2 * mPadding; graphics->setColor(mHighlightColor); graphics->drawRectangle(Rect(mPadding, mPadding, mDimension.width - h - pad, h - pad)); @@ -321,11 +321,10 @@ void DropDown::safeDrawFrame(Graphics *const graphics) void DropDown::drawButton(Graphics *const graphics) { - const int height = mDroppedDown ? mFoldedUpHeight : mDimension.height; - - Image *image = buttons[mDroppedDown][mPushed]; + Image *const image = buttons[mDroppedDown][mPushed]; if (image != nullptr) { + const int height = mDroppedDown ? mFoldedUpHeight : mDimension.height; graphics->drawImage(image, mDimension.width - image->getWidth() - mImagePadding, (height - image->getHeight()) / 2); |