forked from qt-creator/qt-creator
fix mode bar animation regression
This commit is contained in:
@@ -103,18 +103,25 @@ void FancyTabBar::paintEvent(QPaintEvent *event)
|
|||||||
void FancyTabBar::mouseMoveEvent(QMouseEvent *e)
|
void FancyTabBar::mouseMoveEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!m_hoverRect.contains(e->pos())) {
|
if (!m_hoverRect.contains(e->pos())) {
|
||||||
|
int newHover = -1;
|
||||||
for (int i = 0; i < count(); ++i) {
|
for (int i = 0; i < count(); ++i) {
|
||||||
QRect area = tabRect(i);
|
QRect area = tabRect(i);
|
||||||
if (area.contains(e->pos())) {
|
if (area.contains(e->pos())) {
|
||||||
m_hoverIndex = i;
|
newHover = i;
|
||||||
QRect oldHoverRect = m_hoverRect;
|
|
||||||
m_hoverRect = area;
|
|
||||||
update(oldHoverRect);
|
|
||||||
m_hoverControl.stop();
|
|
||||||
m_hoverControl.start();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_hoverControl.stop();
|
||||||
|
m_hoverIndex = newHover;
|
||||||
|
update(m_hoverRect);
|
||||||
|
m_hoverRect = QRect();
|
||||||
|
|
||||||
|
if (m_hoverIndex >=0) {
|
||||||
|
QRect oldHoverRect = m_hoverRect;
|
||||||
|
m_hoverRect = tabRect(m_hoverIndex);
|
||||||
|
m_hoverControl.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user