diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-14 02:54:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-14 02:54:44 +0300 |
commit | 84499779fcf0c8b5392a88f1c9311775e692ebef (patch) | |
tree | f390326a50eed73d8f8c62107979a4d81093ce52 /src/gui/widgets/button.cpp | |
parent | 4ee30f47b491de0ace9b692072fd286cf12c7828 (diff) | |
download | manaplus-84499779fcf0c8b5392a88f1c9311775e692ebef.tar.gz manaplus-84499779fcf0c8b5392a88f1c9311775e692ebef.tar.bz2 manaplus-84499779fcf0c8b5392a88f1c9311775e692ebef.tar.xz manaplus-84499779fcf0c8b5392a88f1c9311775e692ebef.zip |
Improve a bit some gui controls speed.
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r-- | src/gui/widgets/button.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index c8f756f6a..ce2dfd74a 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -433,19 +433,20 @@ void Button::widgetMoved(const gcn::Event &event A_UNUSED) void Button::adjustSize() { + const gcn::Font *const font = getFont(); if (mImages) { - setWidth(getFont()->getWidth(mCaption) + setWidth(font->getWidth(mCaption) + mImageWidth + 2 + 2 * mSpacing); - int height = getFont()->getHeight(); + int height = font->getHeight(); if (height < mImageHeight) height = mImageHeight; setHeight(height + 2 * mSpacing); } else { - setWidth(getFont()->getWidth(mCaption) + 2 * mSpacing); - setHeight(getFont()->getHeight() + 2 * mSpacing); + setWidth(font->getWidth(mCaption) + 2 * mSpacing); + setHeight(font->getHeight() + 2 * mSpacing); } } |