use druid::{ArcStr, Color, Data, Key};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Data, PartialEq, Eq, Deserialize, Serialize)]
pub struct IconData(pub u32, pub u32, pub String);
pub type IconColorKey = Key<Color>;
pub type IconPathKey = Key<ArcStr>;
pub type IconKeyPair = (IconPathKey, IconColorKey, IconColorKey);
impl From<String> for IconData {
fn from(v: String) -> Self {
Self(0x000000FF, 0xFFFFFFFF, v)
}
}
impl From<&str> for IconData {
fn from(v: &str) -> Self {
Self(0x000000FF, 0xFFFFFFFF, v.into())
}
}
impl From<(u32, String)> for IconData {
fn from(v: (u32, String)) -> Self {
Self(v.0, v.0, v.1)
}
}
impl From<(u32, &str)> for IconData {
fn from(v: (u32, &str)) -> Self {
Self(v.0, v.0, v.1.into())
}
}
scl_macro::icons_def! {
empty "";
}