summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-17 16:34:36 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-17 16:34:36 +0300
commitc6c4eef4e49bb4de90845408af9f642a1a4e224b (patch)
tree81d192e85b3c075cb2e52671bea4c3c0499dc3f2 /src/gui/widgets/tabbedarea.cpp
parent093e392dd84c920d26bca17d48ac6611393d087c (diff)
downloadmanaplus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.gz
manaplus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.bz2
manaplus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.xz
manaplus-c6c4eef4e49bb4de90845408af9f642a1a4e224b.zip
Improve size calculations.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 96e81b534..43e829a4e 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -342,7 +342,7 @@ void TabbedArea::updateTabsWidth()
void TabbedArea::updateVisibleTabsWidth()
{
mVisibleTabsWidth = 0;
- for (unsigned int i = mTabScrollIndex; i < mTabs.size(); ++i)
+ for (size_t i = mTabScrollIndex, sz = mTabs.size(); i < sz; ++i)
{
if (mTabs[i].first)
mVisibleTabsWidth += mTabs[i].first->getWidth();
@@ -352,14 +352,15 @@ void TabbedArea::updateVisibleTabsWidth()
void TabbedArea::adjustTabPositions()
{
int maxTabHeight = 0;
- for (unsigned i = 0; i < mTabs.size(); ++i)
+ size_t sz = mTabs.size();
+ for (size_t i = 0; i < sz; ++i)
{
if (mTabs[i].first && mTabs[i].first->getHeight() > maxTabHeight)
maxTabHeight = mTabs[i].first->getHeight();
}
int x = mArrowButton[0]->isVisible() ? mArrowButton[0]->getWidth() : 0;
- for (unsigned i = mTabScrollIndex; i < mTabs.size(); ++i)
+ for (size_t i = mTabScrollIndex; i < sz; ++i)
{
gcn::Tab* tab = mTabs[i].first;
if (!tab)