mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
ComboTabBar:: Call ensureVisible only after resize event is processed
Also change delay to call ensureVisible after current tab is changed to 100ms
This commit is contained in:
parent
42eadaeb2f
commit
4c7735139e
@ -578,6 +578,8 @@ int ComboTabBar::pinTabBarWidth() const
|
||||
|
||||
bool ComboTabBar::event(QEvent *event)
|
||||
{
|
||||
const bool res = QWidget::event(event);
|
||||
|
||||
switch (event->type()) {
|
||||
case QEvent::ToolTip:
|
||||
if (!isDragInProgress() && !isScrollInProgress()) {
|
||||
@ -606,7 +608,7 @@ bool ComboTabBar::event(QEvent *event)
|
||||
break;
|
||||
}
|
||||
|
||||
return QWidget::event(event);
|
||||
return res;
|
||||
}
|
||||
|
||||
void ComboTabBar::wheelEvent(QWheelEvent* event)
|
||||
@ -1394,7 +1396,6 @@ void TabBarScrollWidget::ensureVisible(int index, int xmargin)
|
||||
if (index < 0 || index >= m_tabBar->count()) {
|
||||
return;
|
||||
}
|
||||
|
||||
xmargin = qMin(xmargin, m_scrollArea->viewport()->width() / 2);
|
||||
|
||||
// Qt Bug? the following lines were taken from QScrollArea::ensureVisible() and
|
||||
|
@ -433,7 +433,7 @@ void TabBar::currentTabChanged(int index)
|
||||
showCloseButton(index);
|
||||
hideCloseButton(m_tabWidget->lastTabIndex());
|
||||
|
||||
QTimer::singleShot(0, this, [=]() {
|
||||
QTimer::singleShot(100, this, [=]() {
|
||||
ensureVisible(index);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user