summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm9
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 38f4dc3abc..2b6f271a40 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1739,7 +1739,6 @@ bool QMacStylePrivate::addWidget(QWidget *w)
bool isScrollBar = (qobject_cast<QScrollBar *>(w));
if (isScrollBar) {
w->installEventFilter(q);
- startAnimate(AquaScrollBar, w);
return true;
}
}
@@ -5106,6 +5105,14 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
QMacStylePrivate::ScrollBarFadeOutDuration);
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);
CGContextSetAlpha(cg, opacity);
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h
index 812c79e158..66691c63f7 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p.h
@@ -211,7 +211,8 @@ public:
lastUpdate(QDateTime::currentMSecsSinceEpoch()),
hovered(false),
lastHovered(0),
- cleared(false)
+ cleared(false),
+ animating(false)
{}
int lastValue;
int lastMinimum;
@@ -221,6 +222,7 @@ public:
bool hovered;
qint64 lastHovered;
bool cleared;
+ bool animating;
};
mutable QMap<const QWidget*, OverlayScrollBarInfo> scrollBarInfos;