animation ========= .. py:module:: qfluentwidgets.common.animation Module Contents --------------- .. autoapisummary:: qfluentwidgets.common.animation.AnimationBase qfluentwidgets.common.animation.TranslateYAnimation qfluentwidgets.common.animation.BackgroundAnimationWidget qfluentwidgets.common.animation.BackgroundColorObject qfluentwidgets.common.animation.DropShadowAnimation qfluentwidgets.common.animation.FluentAnimationSpeed qfluentwidgets.common.animation.FluentAnimationType qfluentwidgets.common.animation.FluentAnimationProperty qfluentwidgets.common.animation.FluentAnimationProperObject qfluentwidgets.common.animation.PositionObject qfluentwidgets.common.animation.ScaleObject qfluentwidgets.common.animation.AngleObject qfluentwidgets.common.animation.OpacityObject qfluentwidgets.common.animation.FluentAnimation qfluentwidgets.common.animation.FastInvokeAnimation qfluentwidgets.common.animation.StrongInvokeAnimation qfluentwidgets.common.animation.FastDismissAnimation qfluentwidgets.common.animation.SoftDismissAnimation qfluentwidgets.common.animation.PointToPointAnimation qfluentwidgets.common.animation.FadeInOutAnimation .. py:class:: AnimationBase(parent: PyQt5.QtWidgets.QWidget) Bases: :py:obj:`PyQt5.QtCore.QObject` Animation base class .. py:method:: eventFilter(obj, e: PyQt5.QtCore.QEvent) .. py:class:: TranslateYAnimation(parent: PyQt5.QtWidgets.QWidget, offset=2) Bases: :py:obj:`AnimationBase` Animation base class .. py:attribute:: valueChanged .. py:attribute:: maxOffset .. py:attribute:: ani .. py:method:: y() .. py:class:: BackgroundAnimationWidget(*args, **kwargs) Background animation widget .. py:attribute:: isHover :value: False .. py:attribute:: isPressed :value: False .. py:attribute:: bgColorObject .. py:attribute:: backgroundColorAni .. py:method:: eventFilter(obj, e) .. py:method:: mousePressEvent(e) .. py:method:: mouseReleaseEvent(e) .. py:method:: enterEvent(e) .. py:method:: leaveEvent(e) .. py:method:: focusInEvent(e) .. py:method:: getBackgroundColor() .. py:method:: setBackgroundColor(color: PyQt5.QtGui.QColor) .. py:property:: backgroundColor .. py:class:: BackgroundColorObject(parent: BackgroundAnimationWidget) Bases: :py:obj:`PyQt5.QtCore.QObject` Background color object .. py:method:: backgroundColor() .. py:class:: DropShadowAnimation(parent: PyQt5.QtWidgets.QWidget, normalColor=QColor(0, 0, 0, 0), hoverColor=QColor(0, 0, 0, 75)) Bases: :py:obj:`PyQt5.QtCore.QPropertyAnimation` Drop shadow animation .. py:attribute:: normalColor .. py:attribute:: hoverColor .. py:attribute:: offset .. py:attribute:: blurRadius :value: 38 .. py:attribute:: isHover :value: False .. py:attribute:: shadowEffect .. py:method:: setBlurRadius(radius: int) .. py:method:: setOffset(dx: int, dy: int) .. py:method:: setNormalColor(color: PyQt5.QtGui.QColor) .. py:method:: setHoverColor(color: PyQt5.QtGui.QColor) .. py:method:: setColor(color) .. py:method:: eventFilter(obj, e) .. py:class:: FluentAnimationSpeed Bases: :py:obj:`enum.Enum` Fluent animation speed .. py:attribute:: FAST :value: 0 .. py:attribute:: MEDIUM :value: 1 .. py:attribute:: SLOW :value: 2 .. py:class:: FluentAnimationType Bases: :py:obj:`enum.Enum` Fluent animation type .. py:attribute:: FAST_INVOKE :value: 0 .. py:attribute:: STRONG_INVOKE :value: 1 .. py:attribute:: FAST_DISMISS :value: 2 .. py:attribute:: SOFT_DISMISS :value: 3 .. py:attribute:: POINT_TO_POINT :value: 4 .. py:attribute:: FADE_IN_OUT :value: 5 .. py:class:: FluentAnimationProperty Bases: :py:obj:`enum.Enum` Fluent animation property .. py:attribute:: POSITION :value: 'position' .. py:attribute:: SCALE :value: 'scale' .. py:attribute:: ANGLE :value: 'angle' .. py:attribute:: OPACITY :value: 'opacity' .. py:class:: FluentAnimationProperObject(parent=None) Bases: :py:obj:`PyQt5.QtCore.QObject` Fluent animation property object .. py:attribute:: objects .. py:method:: getValue() .. py:method:: setValue() .. py:method:: register(name) :classmethod: register menu animation manager Parameters ---------- name: Any the name of manager, it should be unique .. py:method:: create(propertyType: FluentAnimationProperty, parent=None) :classmethod: .. py:class:: PositionObject(parent=None) Bases: :py:obj:`FluentAnimationProperObject` Position object .. py:method:: getValue() .. py:method:: setValue(pos: PyQt5.QtCore.QPoint) .. py:attribute:: position .. py:class:: ScaleObject(parent=None) Bases: :py:obj:`FluentAnimationProperObject` Scale object .. py:method:: getValue() .. py:method:: setValue(scale: float) .. py:attribute:: scale .. py:class:: AngleObject(parent=None) Bases: :py:obj:`FluentAnimationProperObject` Angle object .. py:method:: getValue() .. py:method:: setValue(angle: float) .. py:attribute:: angle .. py:class:: OpacityObject(parent=None) Bases: :py:obj:`FluentAnimationProperObject` Opacity object .. py:method:: getValue() .. py:method:: setValue(opacity: float) .. py:attribute:: opacity .. py:class:: FluentAnimation(parent=None) Bases: :py:obj:`PyQt5.QtCore.QPropertyAnimation` Fluent animation base .. py:attribute:: animations .. py:method:: createBezierCurve(x1, y1, x2, y2) :classmethod: .. py:method:: curve() :classmethod: .. py:method:: setSpeed(speed: FluentAnimationSpeed) set the speed of animation .. py:method:: speedToDuration(speed: FluentAnimationSpeed) .. py:method:: startAnimation(endValue, startValue=None) .. py:method:: value() .. py:method:: setValue(value) .. py:method:: register(name) :classmethod: register menu animation manager Parameters ---------- name: Any the name of manager, it should be unique .. py:method:: create(aniType: FluentAnimationType, propertyType: FluentAnimationProperty, speed=FluentAnimationSpeed.FAST, value=None, parent=None) -> FluentAnimation :classmethod: .. py:class:: FastInvokeAnimation(parent=None) Bases: :py:obj:`FluentAnimation` Fast invoke animation .. py:method:: curve() :classmethod: .. py:method:: speedToDuration(speed: FluentAnimationSpeed) .. py:class:: StrongInvokeAnimation(parent=None) Bases: :py:obj:`FluentAnimation` Strong invoke animation .. py:method:: curve() :classmethod: .. py:method:: speedToDuration(speed: FluentAnimationSpeed) .. py:class:: FastDismissAnimation(parent=None) Bases: :py:obj:`FastInvokeAnimation` Fast dismiss animation .. py:class:: SoftDismissAnimation(parent=None) Bases: :py:obj:`FluentAnimation` Soft dismiss animation .. py:method:: curve() :classmethod: .. py:method:: speedToDuration(speed: FluentAnimationSpeed) .. py:class:: PointToPointAnimation(parent=None) Bases: :py:obj:`FastDismissAnimation` Point to point animation .. py:method:: curve() :classmethod: .. py:class:: FadeInOutAnimation(parent=None) Bases: :py:obj:`FluentAnimation` Fade in/out animation .. py:method:: speedToDuration(speed: FluentAnimationSpeed)