diff options
author | Elvis Angelaccio <elvis.angelaccio@kde.org> | 2017-05-26 12:51:33 +0200 |
---|---|---|
committer | Elvis Angelaccio <elvis.angelaccio@kde.org> | 2017-06-04 12:30:08 +0000 |
commit | 04eba7b538072e2811f074bf66fd41f27c90b35c (patch) | |
tree | 4e2c8e01560cb2f8b1aec34ebd2497a508b474bc /src/widgets/styles/qstylesheetstyle.cpp | |
parent | 4480f47f7b0f81483b0cf3c8327eff12938ca018 (diff) |
QStyle: deprecate SH_Widget_Animate in favor of SH_Widget_Animation_Duration
This change introduces a new SH_Widget_Animation_Duration style hint
that applications can query instead of manually hardcoding the duration
of an animation.
As default value we use 200, which is the value that was already used in
QWidgetAnimator. A value equal to 0 means that the animations will be
disabled. This also implies that the SH_Widget_Animate style hint is
superseded and can be deprecated.
The new style hint is configurable with style sheets.
[ChangeLog][QtWidgets][Styles] Added SH_Widget_Animation_Duration style
hint which deprecates SH_Widget_Animate.
Change-Id: Ic3f5e4f7145a89697f28666aeaecabb1f3c5c96f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 39a3e110f3..4fe697a32f 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -691,7 +691,8 @@ static const char knownStyleHints[][45] = { "titlebar-unshade-icon", "toolbutton-popup-delay", "trash-icon", - "uparrow-icon" + "uparrow-icon", + "widget-animation-duration" }; static const int numKnownStyleHints = sizeof(knownStyleHints)/sizeof(knownStyleHints[0]); @@ -5325,6 +5326,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi case SH_ItemView_ArrowKeysNavigateIntoChildren: s = QLatin1String("arrow-keys-navigate-into-children"); break; case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: s = QLatin1String("paint-alternating-row-colors-for-empty-area"); break; case SH_TitleBar_ShowToolTipsOnButtons: s = QLatin1String("titlebar-show-tooltips-on-buttons"); break; + case SH_Widget_Animation_Duration: s = QLatin1String("widget-animation-duration"); break; default: break; } if (!s.isEmpty() && rule.hasStyleHint(s)) { |