use fission::prelude::*;
fission_component! {
pub FadedPreview<()> {
props { content: Widget }
}
view(preview, _state, _cx) =>
Composite(preview.content.clone()).opacity(0.72).translate_y(-4.0)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable widget identity. | Defaults to None. |
style | CompositeStyle | Visual presentation settings for the child. | Defaults to CompositeStyle::default(), which means no extra effect. |
child | Widget | The wrapped child widget. | Required. Composite::default() uses an empty spacer child. |
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
opacity | Option<CompositeScalar> | Alpha multiplier for the child. | None means fully opaque. |
translate_x | Option<CompositeScalar> | Horizontal visual translation. | Does not relayout siblings. |
translate_y | Option<CompositeScalar> | Vertical visual translation. | Does not relayout siblings. |
scale | Option<CompositeScalar> | Uniform visual scale. | None means 1.0. |
rotation | Option<CompositeScalar> | Visual rotation value. | Stored as a composited scalar rather than a full matrix. |
clip_to_bounds | bool | Whether compositing should respect the child's bounds as a clip. | Defaults to false. |
repaint_boundary | bool | Hint that the subtree should behave as its own repaint boundary. | Defaults to false. |