QStyleAnimation: Go down to 15 fps
The new implementation of CE_ProgressBarContents in QMacStyle uses NSProgressIndicator, which is noticeably heavier than the previously used HITheme API. Setting the animation frame rate to 20 fps improves things significantly compared to the default 30 fps, but Cocoa seems to update the animation at 15 fps for indeterminate NSProgressIndicator. Going down to 12 or 10 fps may be an option in the future, but it's not compatible with NSProgressIndicator. Change-Id: Ie1e18d7d78d1bd7ea38a12d715a6a7db0e175a29 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
This commit is contained in:
parent
83cbb31460
commit
0e3d6214df
@ -4599,8 +4599,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||||||
// implementation for details.
|
// implementation for details.
|
||||||
if (!animation && opt->styleObject) {
|
if (!animation && opt->styleObject) {
|
||||||
auto *animation = new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject);
|
auto *animation = new QProgressStyleAnimation(d->animateSpeed(QMacStylePrivate::AquaProgressBar), opt->styleObject);
|
||||||
// NSProgressIndicator is heavier to draw than the HITheme API, so we reduce the frame rate a notch.
|
// NSProgressIndicator is heavier to draw than the HITheme API, so we reduce the frame rate a couple notches.
|
||||||
animation->setFrameRate(QStyleAnimation::TwentyFps);
|
animation->setFrameRate(QStyleAnimation::FifteenFps);
|
||||||
d->startAnimation(animation);
|
d->startAnimation(animation);
|
||||||
[ipi startAnimation];
|
[ipi startAnimation];
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,8 @@ public:
|
|||||||
DefaultFps,
|
DefaultFps,
|
||||||
SixtyFps,
|
SixtyFps,
|
||||||
ThirtyFps,
|
ThirtyFps,
|
||||||
TwentyFps
|
TwentyFps,
|
||||||
|
FifteenFps
|
||||||
};
|
};
|
||||||
|
|
||||||
FrameRate frameRate() const;
|
FrameRate frameRate() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user