Fluent-Qt

Particles

ParticleBackdrop

Flowing ribbons, floating dots and a starfield with pointer ripples, theme-aware colors, and controls for motion and density.

Example

ParticleBackdrop: Flowing ribbons

Usage

Flowing ribbons

A quiet animated surface follows the current theme and motion preference.

#include <FluentQt/Particles.h>
using namespace fluent::particles;

auto* backdrop = new ParticleBackdrop(this);
backdrop->setEffect(ParticleBackdrop::FlowingRibbons);
backdrop->setBackgroundMode(ParticleBackdrop::Solid);
backdrop->setParticleCount(240);
backdrop->setMaximumFrameRate(30);
backdrop->setMinimumHeight(240);
backdrop->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);

fluent::particles::ParticleBackdrop

Inherits QWidget · FluentElement · QMLPlus

CPU-default particle presets behind caller-composed content.

Constructors

Properties

Effect effect
Read effect()Write setEffect()Notify effectChanged()
bool animationEnabled
Read isAnimationEnabled()Write setAnimationEnabled()Notify animationEnabledChanged()
bool animating

Effective timer state after policy and visibility.

Read isAnimating()Notify animatingChanged()
bool gpuAccelerationEnabled

Permit an optional Spatial compositor to accelerate painting; false by default.

Read isGpuAccelerationEnabled()Write setGpuAccelerationEnabled()Notify gpuAccelerationEnabledChanged()
qreal speed
Read speed()Write setSpeed()Notify speedChanged()
int particleCount
Read particleCount()Write setParticleCount()Notify particleCountChanged()
int maximumFrameRate
Read maximumFrameRate()Write setMaximumFrameRate()Notify maximumFrameRateChanged()
bool interactive
Read isInteractive()Write setInteractive()Notify interactiveChanged()
bool pauseWhenInactive
Read isPauseWhenInactive()Write setPauseWhenInactive()Notify pauseWhenInactiveChanged()
BackgroundMode backgroundMode
Read backgroundMode()Write setBackgroundMode()Notify backgroundModeChanged()
QMarginsF fadeMargins
Read fadeMargins()Write setFadeMargins()Notify fadeMarginsChanged()

Methods

void setEffect(Effect effect)

Switches the effect, preserving settings and restarting its phase; invalid values are ignored.

bool isAnimating() const

Effective timer state after policy and visibility.

bool isGpuAccelerationEnabled() const

Permit an optional Spatial compositor to accelerate painting; false by default.

void setGpuAccelerationEnabled(bool enabled)

Permit an optional Spatial compositor to accelerate painting; false by default.

void setSpeed(qreal speed)

Sets speed in [0, 4]; zero freezes motion.

void setParticleCount(int count)

Sets the particle count in [0, 960]; ribbon accents are independent.

void setMaximumFrameRate(int framesPerSecond)

Caps scheduled frames to [1, 60] per second.

void setPauseWhenInactive(bool pause)

Controls pausing on application deactivation.

void setFadeMargins(const QMarginsF& margins)

Sets nonnegative edge fade widths in logical pixels.

void triggerRipple(const QPointF& position)

Emits a decorative ripple in local coordinates when motion is allowed.

Signals

void animatingChanged(bool animating)

Effective timer state after policy and visibility.

void gpuAccelerationEnabledChanged(bool enabled)

Permit an optional Spatial compositor to accelerate painting; false by default.

Enumerations

enum Effect

Built-in CPU particle effects.

  • FlowingRibbons Orbiting ribbons and sparks.
  • FloatingDots Soft lights drifting upward.
  • Starfield Stars moving toward the viewer.
enum BackgroundMode

Background composition.

  • Transparent
  • Solid

Destructors

Subclass interfaces

Methods

Inherited from fluent::FluentElement

Methods

static void setTheme(Theme theme)

Updates the global theme and notifies active FluentElement instances.

static void setThemeDeferred(Theme theme)

Schedules a visible-first batched theme refresh without blocking the current interaction.

static Theme currentTheme()

Returns the currently active global theme.

static bool themeUsesDarkAppearance(Theme theme)

Returns whether a theme uses dark-backed chrome and material tokens.

static void refreshTheme()

Re-broadcasts the current theme to repaint after a design-token change.

static int themeGeneration()

Monotonic counter bumped on every theme change, for staleness checks.

Theme effectiveTheme() const

Resolves the theme used by this element, honoring an inherited QWidget override.

bool effectiveThemeUsesDarkAppearance() const

Returns whether this element's effective theme uses dark-backed chrome.

QJsonObject themeOverrides() const

Returns this element's authored overrides.

void clearThemeOverrides()

Restores all token fields to global theme defaults.

const Colors& themeColorsRef() const

Non-copying access to the active color set (for hot paint paths).

Material::AcrylicToken themeAcrylic() const

Material, elevation, and adaptive layout tokens.

QColor themeBackdrop(bool active) const

Window-chrome backdrop color for the given activation state.

virtual void onThemeUpdated()

Called after the global theme changes.

Enumerations

enum Theme

Global visual theme used when resolving design tokens.

  • Light = 0
  • Dark = 1
  • HighContrast = 2

Types and aliases

struct Colors

Design token snapshots returned to components.

Inherited from fluent::QMLPlus

Methods

AnchorLayout::Anchors* anchors()

Returns mutable anchors for the QWidget host.

void setState(const QString& name)

Applies a named state, or clears state when name is empty.

void addState(const QMLState& state)

Registers or replaces a named state definition.

void evaluateStates()

Reevaluates conditions; the first registered true condition wins.

QMLPlusRuntime* runtime()

Returns the lazy host-owned state observation object.

void setAnchors(const AnchorLayout::Anchors& anchors)

Replaces all host anchors and invalidates the parent layout.

void resetAnchors()

Clears all host anchors and invalidates the parent layout.

void addTransition(const StateTransition& transition)

Registers a state transition in precedence order.

void setBehavior(const char* propertyName, const PropertyAnimation& animation)

Sets the default animation for this host's managed property writes.

void clearBehavior(const char* propertyName)

Removes the default animation for future managed writes.

bool writeProperty(const char* propertyName, const QVariant& value)

Writes a host property through Behavior without removing its binding.

All inherited Qt members:QWidget