Mac: Adapt scrollbar fadeout animation for QStyleAnimation
Change-Id: I39f1089e8d6ba1bb412d33aa4ebc0971aba52681 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
parent
4c41cb48d0
commit
c4ff5c53ef
@ -1739,7 +1739,6 @@ bool QMacStylePrivate::addWidget(QWidget *w)
|
|||||||
bool isScrollBar = (qobject_cast<QScrollBar *>(w));
|
bool isScrollBar = (qobject_cast<QScrollBar *>(w));
|
||||||
if (isScrollBar) {
|
if (isScrollBar) {
|
||||||
w->installEventFilter(q);
|
w->installEventFilter(q);
|
||||||
startAnimate(AquaScrollBar, w);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5106,6 +5105,14 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||||||
QMacStylePrivate::ScrollBarFadeOutDuration);
|
QMacStylePrivate::ScrollBarFadeOutDuration);
|
||||||
info.cleared = opacity <= 0.0;
|
info.cleared = opacity <= 0.0;
|
||||||
|
|
||||||
|
if (info.animating && info.cleared) {
|
||||||
|
d->stopAnimation(slider->styleObject);
|
||||||
|
info.animating = false;
|
||||||
|
} else if (!info.animating && !info.cleared) {
|
||||||
|
d->startAnimation(new QStyleAnimation(slider->styleObject));
|
||||||
|
info.animating = true;
|
||||||
|
}
|
||||||
|
|
||||||
CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect), NULL);
|
CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect), NULL);
|
||||||
CGContextSetAlpha(cg, opacity);
|
CGContextSetAlpha(cg, opacity);
|
||||||
|
|
||||||
|
@ -211,7 +211,8 @@ public:
|
|||||||
lastUpdate(QDateTime::currentMSecsSinceEpoch()),
|
lastUpdate(QDateTime::currentMSecsSinceEpoch()),
|
||||||
hovered(false),
|
hovered(false),
|
||||||
lastHovered(0),
|
lastHovered(0),
|
||||||
cleared(false)
|
cleared(false),
|
||||||
|
animating(false)
|
||||||
{}
|
{}
|
||||||
int lastValue;
|
int lastValue;
|
||||||
int lastMinimum;
|
int lastMinimum;
|
||||||
@ -221,6 +222,7 @@ public:
|
|||||||
bool hovered;
|
bool hovered;
|
||||||
qint64 lastHovered;
|
qint64 lastHovered;
|
||||||
bool cleared;
|
bool cleared;
|
||||||
|
bool animating;
|
||||||
};
|
};
|
||||||
mutable QMap<const QWidget*, OverlayScrollBarInfo> scrollBarInfos;
|
mutable QMap<const QWidget*, OverlayScrollBarInfo> scrollBarInfos;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user