Adw.TimedAnimation

g Adw.Animation Adw.Animation Adw.TimedAnimation Adw.TimedAnimation Adw.Animation->Adw.TimedAnimation GObject.Object GObject.Object GObject.Object->Adw.Animation

Subclasses:

None

Methods

Inherited:

Adw.Animation (12), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (widget, from_, to, duration, target)

get_alternate ()

get_duration ()

get_easing ()

get_repeat_count ()

get_reverse ()

get_value_from ()

get_value_to ()

set_alternate (alternate)

set_duration (duration)

set_easing (easing)

set_repeat_count (repeat_count)

set_reverse (reverse)

set_value_from (value)

set_value_to (value)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

Adw.Animation (5)

Name

Type

Flags

Short Description

alternate

bool

r/w/c/en

duration

int

r/w/c/en

easing

Adw.Easing

r/w/c/en

repeat-count

int

r/w/c/en

reverse

bool

r/w/c/en

value-from

float

r/w/c/en

value-to

float

r/w/c/en

Signals

Inherited:

Adw.Animation (1), GObject.Object (1)

Fields

Inherited:

Adw.Animation (1), GObject.Object (1)

Class Details

class Adw.TimedAnimation(**kwargs)
Bases:

Adw.Animation

Abstract:

No

Structure:

Adw.TimedAnimationClass

A time-based [class`Animation`].

AdwTimedAnimation implements a simple animation interpolating the given value from [property`TimedAnimation`:py:data::value-from<Adw.TimedAnimation.props.value_from>] to [property`TimedAnimation`:py:data::value-to<Adw.TimedAnimation.props.value_to>] over [property`TimedAnimation`:py:data::duration<Adw.TimedAnimation.props.duration>] milliseconds using the curve described by [property`TimedAnimation`:py:data::easing<Adw.TimedAnimation.props.easing>].

If [property`TimedAnimation`:py:data::reverse<Adw.TimedAnimation.props.reverse>] is set to TRUE, AdwTimedAnimation will instead animate from [property`TimedAnimation`:py:data::value-to<Adw.TimedAnimation.props.value_to>] to [property`TimedAnimation`:py:data::value-from<Adw.TimedAnimation.props.value_from>], and the easing curve will be inverted.

The animation can repeat a certain amount of times, or endlessly, depending on the [property`TimedAnimation`:py:data::repeat-count<Adw.TimedAnimation.props.repeat_count>] value. If [property`TimedAnimation`:py:data::alternate<Adw.TimedAnimation.props.alternate>] is set to TRUE, it will also change the direction every other iteration.

classmethod new(widget, from_, to, duration, target)
Parameters:
  • widget (Gtk.Widget) – a widget to create animation on

  • from (float) – a value to animate from

  • to (float) – a value to animate to

  • duration (int) – a duration for the animation

  • target (Adw.AnimationTarget) – a target value to animate

Returns:

the newly created animation

Return type:

Adw.Animation

Creates a new AdwTimedAnimation on widget to animate target from from to to.

get_alternate()
Returns:

whether self alternates

Return type:

bool

Gets whether self changes direction on every iteration.

get_duration()
Returns:

the duration of self, in milliseconds

Return type:

int

Gets the duration of self.

get_easing()
Returns:

the easing function self uses

Return type:

Adw.Easing

Gets the easing function self uses.

get_repeat_count()
Returns:

the number of times self will play

Return type:

int

Gets the number of times self will play.

get_reverse()
Returns:

whether self plays backwards

Return type:

bool

Gets whether self plays backwards.

get_value_from()
Returns:

the value to animate from

Return type:

float

Gets the value self will animate from.

get_value_to()
Returns:

the value to animate to

Return type:

float

Gets the value self will animate to.

set_alternate(alternate)
Parameters:

alternate (bool) – whether self alternates

Sets whether self changes direction on every iteration.

set_duration(duration)
Parameters:

duration (int) – the duration to use, in milliseconds

Sets the duration of self.

If the animation repeats more than once, sets the duration of one iteration.

set_easing(easing)
Parameters:

easing (Adw.Easing) – the easing function to use

Sets the easing function self will use.

See [enum`Easing`] for the description of specific easing functions.

set_repeat_count(repeat_count)
Parameters:

repeat_count (int) – the number of times self will play

Sets the number of times self will play.

If set to 0, self will repeat endlessly.

set_reverse(reverse)
Parameters:

reverse (bool) – whether self plays backwards

Sets whether self plays backwards.

set_value_from(value)
Parameters:

value (float) – the value to animate from

Sets the value self will animate from.

The animation will start at this value and end at [property`TimedAnimation`:py:data::value-to<Adw.TimedAnimation.props.value_to>].

If [property`TimedAnimation`:py:data::reverse<Adw.TimedAnimation.props.reverse>] is TRUE, the animation will end at this value instead.

set_value_to(value)
Parameters:

value (float) – the value to animate to

Sets the value self will animate to.

The animation will start at [property`TimedAnimation`:py:data::value-from<Adw.TimedAnimation.props.value_from>] and end at this value.

If [property`TimedAnimation`:py:data::reverse<Adw.TimedAnimation.props.reverse>] is TRUE, the animation will start at this value instead.

Property Details

Adw.TimedAnimation.props.alternate
Name:

alternate

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Whether the animation changes direction on every iteration.

Adw.TimedAnimation.props.duration
Name:

duration

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Duration of the animation, in milliseconds.

Describes how much time the animation will take.

If the animation repeats more than once, describes the duration of one iteration.

Adw.TimedAnimation.props.easing
Name:

easing

Type:

Adw.Easing

Default Value:

Adw.Easing.EASE_OUT_CUBIC

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Easing function used in the animation.

Describes the curve the value is interpolated on.

See [enum`Easing`] for the description of specific easing functions.

Adw.TimedAnimation.props.repeat_count
Name:

repeat-count

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Number of times the animation will play.

If set to 0, the animation will repeat endlessly.

Adw.TimedAnimation.props.reverse
Name:

reverse

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Whether the animation plays backwards.

Adw.TimedAnimation.props.value_from
Name:

value-from

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

The value to animate from.

The animation will start at this value and end at [property`TimedAnimation`:py:data::value-to<Adw.TimedAnimation.props.value_to>].

If [property`TimedAnimation`:py:data::reverse<Adw.TimedAnimation.props.reverse>] is TRUE, the animation will end at this value instead.

Adw.TimedAnimation.props.value_to
Name:

value-to

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

The value to animate to.

The animation will start at [property`TimedAnimation`:py:data::value-from<Adw.TimedAnimation.props.value_from>] and end at this value.

If [property`TimedAnimation`:py:data::reverse<Adw.TimedAnimation.props.reverse>] is TRUE, the animation will start at this value instead.