psychic-ui 0.0.0
Loading...
Searching...
No Matches
psychic_ui::Transition Class Reference

#include <Properties.hpp>

Public Member Functions

 Transition (std::initializer_list< Property > properties, Timing timing)
Transition & add (const PropertyMask &properties, const Timing &timing)
const Timing * timing (Property property) const
PropertyMask properties () const
bool empty () const
bool operator== (const Transition &) const =default

Static Public Attributes

static constexpr std::size_t capacity = 4

Detailed Description

The transition style property: which properties blend from their old value to their new one when it changes, and with what timing, like CSS's transition. A few timings, each for a set of properties:

manager->style("Button")
    .transition({Property::backgroundColor, Property::borderColor}, Timing{100ms})
    .transition(Property::outlineColor, Timing{150ms, Ease::Out});

Like CSS's, it cascades as a whole: the rule that wins sets every transition of the div, the others' don't add to it. Only animatable properties (see PSYCHIC_UI_STYLE_PROPERTIES) blend; the others change at once.

Member Function Documentation

◆ add()

Transition & psychic_ui::Transition::add ( const PropertyMask & properties,
const Timing & timing )

These properties blend with this timing (replacing their earlier timing). Throws std::length_error past capacity timings.

◆ properties()

PropertyMask psychic_ui::Transition::properties ( ) const
nodiscard

The properties with a timing

◆ timing()

const Timing * psychic_ui::Transition::timing ( Property property) const
nodiscard

The timing of a property, nullptr when it doesn't transition

Member Data Documentation

◆ capacity

std::size_t psychic_ui::Transition::capacity = 4
staticconstexpr

How many different timings one transition holds


The documentation for this class was generated from the following files: