glassy_ui/motion/
variants.rs1use std::collections::HashMap;
2
3use gpui::SharedString;
4
5use super::style::MotionStyle;
6
7#[derive(Clone, Default)]
18pub struct Variants {
19 map: HashMap<SharedString, MotionStyle>,
20}
21
22impl Variants {
23 pub fn new() -> Self {
24 Self::default()
25 }
26
27 pub fn set(mut self, name: impl Into<SharedString>, style: MotionStyle) -> Self {
28 self.map.insert(name.into(), style);
29 self
30 }
31
32 pub fn get(&self, name: &str) -> Option<MotionStyle> {
33 self.map.get(name).copied()
34 }
35}