cf::ui::widget::material::base::RippleHelper¶
Material Design ripple effect helper. More...
#include <ripple_helper.h>
Inherits from QObject
Public Types¶
| Name | |
|---|---|
| enum class | Mode { Bounded, Unbounded} Ripple rendering mode. |
Public Signals¶
| Name | |
|---|---|
| void | repaintNeeded() Signal emitted when repaint is needed. |
Public Functions¶
| Name | |
|---|---|
| RippleHelper(cf::WeakPtr< components::material::CFMaterialAnimationFactory > factory, QObject * parent) Constructor with animation factory. |
|
| void | setMode(Mode mode) Sets the ripple rendering mode. |
| void | setColor(constcf::ui::base::CFColor & color) Sets the ripple color. |
| void | onPress(constQPoint & pos, constQRectF & widgetRect) Handles press event. |
| void | onRelease() Handles release event. |
| void | onCancel() Handles cancel event. |
| void | paint(QPainter * painter, constQPainterPath & clipPath) Paints the ripples. |
| bool | hasActiveRipple() const Checks if there are active ripples. |
Detailed Description¶
Material Design ripple effect helper.
Since: N/A
Manages ripple effects for Material Design widgets. Provides animated ripple propagation on press/release interactions with bounded and unbounded modes.
Public Types Documentation¶
enum Mode¶
| Enumerator | Value | Description |
|---|---|---|
| Bounded | Clipped by widget bounds. | |
| Unbounded | Not clipped by widget bounds. |
Ripple rendering mode.
Since: N/A
Public Signals Documentation¶
signal repaintNeeded¶
Signal emitted when repaint is needed.
Since: N/A
Public Functions Documentation¶
function RippleHelper¶
explicit RippleHelper(
cf::WeakPtr< components::material::CFMaterialAnimationFactory > factory,
QObject * parent
)
Constructor with animation factory.
Parameters:
- factory WeakPtr to the animation factory.
- parent QObject parent.
- factory WeakPtr to animation factory for ripple animations.
- parent QObject parent for memory management.
Exceptions:
- None
Since: N/A
Note: None
Warning: None
Constructor - initializes ripple controller.
function setMode¶
Sets the ripple rendering mode.
Parameters:
- mode Rendering mode to use.
Exceptions:
- None
Since: N/A
Note: None
Warning: None
function setColor¶
Sets the ripple color.
Parameters:
- color Ripple color (typically the state color).
Exceptions:
- None
Since: N/A
Note: None
Warning: None
function onPress¶
Handles press event.
Parameters:
- pos Press position coordinates.
- widgetRect Widget bounding rectangle.
Exceptions:
- None
Since: N/A
Note: Creates a new ripple at the press position.
Warning: None
function onRelease¶
Handles release event.
Exceptions:
- None
Since: N/A
Note: Starts ripple fade-out animation.
Warning: None
function onCancel¶
Handles cancel event.
Exceptions:
- None
Since: N/A
Note: Cancels unreleased ripples (e.g., when mouse leaves widget).
Warning: None
function paint¶
Paints the ripples.
Parameters:
- painter QPainter to render with.
- clipPath Clipping path for bounded mode.
Exceptions:
- None
Since: N/A
Note: Call in paintEvent.
Warning: None
function hasActiveRipple¶
Checks if there are active ripples.
Exceptions:
- None
Return: true if any ripples are active, false otherwise.
Since: N/A
Note: Used to determine if repaint is needed.
Warning: None
Updated on 2026-03-09 at 10:14:01 +0000