[KCollapsibleGroupBox] Respect style's widget animation duration
ClosedPublic

Authored by cfeck on Sep 20 2018, 12:48 AM.

Details

Summary

Query QStyle::SH_Widget_Animation_Duration style hint.
QTimeLine requires a duration > 0, so use 1 [ms] to make the animation as fast as possible when disabled.

BUG: 397103
FIXED-IN: 5.51.0

Test Plan

./bin/kcollapsiblegroupboxtest with Breeze animations enabled and disabled and with different duration settings.

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cfeck created this revision.Sep 20 2018, 12:48 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptSep 20 2018, 12:48 AM
cfeck requested review of this revision.Sep 20 2018, 12:48 AM

Shouldn't the duration respect the global setting rather than being hardcoded to 500ms?

SH_Widget_Animate is deprecated in favor of SH_Widget_Animation_Duration introduced in Qt 5.10, so perhaps this needs an ifdef

cfeck updated this revision to Diff 41978.Sep 20 2018, 12:11 PM
cfeck retitled this revision from [KCollapsibleGroupBox] Respect styles that disable widget animations to [KCollapsibleGroupBox] Respect style's widget animation duration.
cfeck edited the summary of this revision. (Show Details)
cfeck edited the test plan for this revision. (Show Details)

Respect QStyle::SH_Widget_Animation_Duration starting with Qt 5.10.0

Indeed Breeze style was already updated to return the actual configured duration on Qt 5.10.

Would KMessageWidget need the same change?

ngraham accepted this revision.Sep 20 2018, 1:05 PM

Indeed Breeze style was already updated to return the actual configured duration on Qt 5.10.

Would KMessageWidget need the same change?

Yeah, I think so. No sense in having a user-tweakable "animation duration" value if we're not going to respect it.

This revision is now accepted and ready to land.Sep 20 2018, 1:05 PM
cfeck added a comment.Sep 20 2018, 4:34 PM

Would KMessageWidget need the same change?

Yeah, I think so. No sense in having a user-tweakable "animation duration" value if we're not going to respect it.

I was skeptical, because my impression was that KMessageWidget animations are intentionally slow to stay readable.

That would only affect the speed of appearing and disappearing though, right? Not the total duration that is status on the screen.

elvisangelaccio accepted this revision.Sep 23 2018, 9:57 AM
This revision was automatically updated to reflect the committed changes.