mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
[TabBar] Fixed crash in tabSizeHint (division by zero).
This commit is contained in:
parent
e9fccbfb75
commit
5828d57277
@ -479,8 +479,8 @@ void ComboTabBar::setUpLayout()
|
||||
{
|
||||
int height = qMax(m_mainTabBar->height(), m_pinnedTabBar->height());
|
||||
|
||||
// Workaround for Oxygen theme. For some reason, m_mainTabBar->height() returns bigger
|
||||
// height than it actually is.
|
||||
// Workaround for Oxygen theme. For some reason, QTabBar::height() returns bigger
|
||||
// height than it actually should.
|
||||
if (mApp->proxyStyle() && mApp->proxyStyle()->name() == QLatin1String("oxygen")) {
|
||||
height -= 4;
|
||||
}
|
||||
|
@ -255,13 +255,13 @@ QSize TabBar::tabSizeHint(int index, bool fast) const
|
||||
m_normalTabWidth = MAXIMUM_TAB_WIDTH;
|
||||
size.setWidth(m_normalTabWidth);
|
||||
}
|
||||
else {
|
||||
else if (normalTabsCount > 0) {
|
||||
int maxWidthForTab = availableWidth / normalTabsCount;
|
||||
int realTabWidth = maxWidthForTab;
|
||||
bool adjustingActiveTab = false;
|
||||
|
||||
if (realTabWidth < MINIMUM_ACTIVE_TAB_WIDTH) {
|
||||
maxWidthForTab = (availableWidth - MINIMUM_ACTIVE_TAB_WIDTH) / (normalTabsCount - 1);
|
||||
maxWidthForTab = normalTabsCount > 1 ? (availableWidth - MINIMUM_ACTIVE_TAB_WIDTH) / (normalTabsCount - 1) : 0;
|
||||
realTabWidth = MINIMUM_ACTIVE_TAB_WIDTH;
|
||||
adjustingActiveTab = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user