use crate::WidgetId;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
pub enum AnimLayer {
#[default]
Root,
Background,
Content,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum AnimProperty {
BackgroundColor,
TextColor,
BorderColor,
Opacity,
Scale,
ContentScale,
ShadowColor,
BorderWidth,
BorderRadius,
Width,
Height,
PaddingLeft,
PaddingTop,
PaddingRight,
PaddingBottom,
MarginLeft,
MarginTop,
MarginRight,
MarginBottom,
GapX,
GapY,
ScrollOffset,
ScrollbarThickness,
}
impl AnimProperty {
pub const fn affects_layout(self) -> bool {
matches!(
self,
Self::BorderWidth |
Self::BorderRadius |
Self::Width |
Self::Height |
Self::PaddingLeft |
Self::PaddingTop |
Self::PaddingRight |
Self::PaddingBottom |
Self::MarginLeft |
Self::MarginTop |
Self::MarginRight |
Self::MarginBottom |
Self::GapX |
Self::GapY
)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct AnimKey {
pub widget: WidgetId,
pub layer: AnimLayer,
pub property: AnimProperty,
}