mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 04:36:34 +01:00
Fix possible crash on startup.
Don't calculate space for tab if the available space is negative.
This commit is contained in:
parent
8581abf472
commit
8cc303a355
@ -194,6 +194,10 @@ QSize TabBar::tabSizeHint(int index) const
|
||||
}
|
||||
else {
|
||||
int availableWidth = width() - (PINNED_TAB_WIDTH * m_pinnedTabsCount) - m_tabWidget->buttonListTabs()->width() - m_tabWidget->buttonAddTab()->width();
|
||||
if (availableWidth < 0) {
|
||||
return QSize(-1, -1);
|
||||
}
|
||||
|
||||
int normalTabsCount = count() - m_pinnedTabsCount;
|
||||
if (availableWidth >= MAXIMUM_TAB_WIDTH * normalTabsCount) {
|
||||
m_normalTabWidth = MAXIMUM_TAB_WIDTH;
|
||||
|
Loading…
Reference in New Issue
Block a user