1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Fixed the issue about computing of rounding errors

This commit is contained in:
S. Razi Alavizadeh 2012-12-11 12:24:40 +03:30
parent 9db9c89eb8
commit 15cc84f1b1

View File

@ -227,7 +227,13 @@ QSize TabBar::tabSizeHint(int index) const
// Fill any empty space (we've got from rounding) with active tab
if (index == currentIndex()) {
m_activeTabWidth = (availableWidth - maxWidthForTab * normalTabsCount) + m_activeTabWidth;
if (adjustingActiveTab) {
m_activeTabWidth = (availableWidth - MINIMUM_ACTIVE_TAB_WIDTH
- maxWidthForTab * (normalTabsCount - 1)) + m_activeTabWidth;
}
else {
m_activeTabWidth = (availableWidth - maxWidthForTab * normalTabsCount) + maxWidthForTab;
}
adjustingActiveTab = true;
size.setWidth(m_activeTabWidth);
}
@ -255,7 +261,13 @@ QSize TabBar::tabSizeHint(int index) const
// Fill any empty space (we've got from rounding) with active tab
if (index == currentIndex()) {
m_activeTabWidth = (availableWidth - maxWidthForTab * normalTabsCount) + m_activeTabWidth;
if (adjustingActiveTab) {
m_activeTabWidth = (availableWidth - MINIMUM_ACTIVE_TAB_WIDTH
- maxWidthForTab * (normalTabsCount - 1)) + m_activeTabWidth;
}
else {
m_activeTabWidth = (availableWidth - maxWidthForTab * normalTabsCount) + maxWidthForTab;
}
adjustingActiveTab = true;
size.setWidth(m_activeTabWidth);
}