1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

ComboTabBar: Event handling cleanup

This commit is contained in:
David Rosca 2015-11-06 18:12:48 +01:00
parent 83b7f8f441
commit fb4782dab2
2 changed files with 11 additions and 28 deletions

View File

@ -588,6 +588,17 @@ bool ComboTabBar::event(QEvent *event)
ensureVisible();
break;
case QEvent::Show:
if (!event->spontaneous())
QTimer::singleShot(0, this, &ComboTabBar::setUpLayout);
break;
case QEvent::Enter:
case QEvent::Leave:
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, &ComboTabBar::updateTabBars);
break;
default:
break;
}
@ -906,31 +917,6 @@ void ComboTabBar::setMinimumWidths()
}
}
void ComboTabBar::showEvent(QShowEvent* event)
{
if (!event->spontaneous()) {
QTimer::singleShot(0, this, SLOT(setUpLayout()));
}
QWidget::showEvent(event);
}
void ComboTabBar::enterEvent(QEvent* event)
{
QWidget::enterEvent(event);
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, SLOT(updateTabBars()));
}
void ComboTabBar::leaveEvent(QEvent* event)
{
QWidget::leaveEvent(event);
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, SLOT(updateTabBars()));
}
TabBarHelper::TabBarHelper(bool isPinnedTabBar, ComboTabBar* comboTabBar)
: QTabBar(comboTabBar)

View File

@ -167,9 +167,6 @@ protected:
bool event(QEvent *event);
void wheelEvent(QWheelEvent* event);
void showEvent(QShowEvent* event);
void enterEvent(QEvent* event);
void leaveEvent(QEvent* event);
bool eventFilter(QObject* obj, QEvent* ev);
void paintEvent(QPaintEvent* ev);