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

[ComboTabBar] Fixed flickering when removing tabs from tabbar

This commit is contained in:
nowrep 2014-02-09 14:26:03 +01:00
parent 6c86c2a6df
commit d21d6c43a0
2 changed files with 11 additions and 0 deletions

View File

@ -133,11 +133,16 @@ int ComboTabBar::insertTab(int index, const QIcon &icon, const QString &text, bo
void ComboTabBar::removeTab(int index)
{
if (validIndex(index)) {
setUpdatesEnabled(false);
localTabBar(index)->removeTab(toLocalIndex(index));
updatePinnedTabBarVisibility();
tabRemoved(index);
setMinimumWidths();
// Enable updates with a small delay to prevent flickering
QTimer::singleShot(50, this, SLOT(enableUpdates()));
}
}
@ -301,6 +306,11 @@ void ComboTabBar::closeTabFromButton()
}
}
void ComboTabBar::enableUpdates()
{
setUpdatesEnabled(true);
}
int ComboTabBar::count() const
{
return pinnedTabsCount() + m_mainTabBar->count();

View File

@ -141,6 +141,7 @@ private slots:
void slotTabCloseRequested(int index);
void slotTabMoved(int from, int to);
void closeTabFromButton();
void enableUpdates();
protected:
int mainTabBarWidth() const;