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:
parent
6c86c2a6df
commit
d21d6c43a0
|
@ -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();
|
||||
|
|
|
@ -141,6 +141,7 @@ private slots:
|
|||
void slotTabCloseRequested(int index);
|
||||
void slotTabMoved(int from, int to);
|
||||
void closeTabFromButton();
|
||||
void enableUpdates();
|
||||
|
||||
protected:
|
||||
int mainTabBarWidth() const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user