mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
ComboTabBar: Event handling cleanup
This commit is contained in:
parent
83b7f8f441
commit
fb4782dab2
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user