migrate ui components to gpui-kit
This commit is contained in:
@@ -10,6 +10,25 @@ use rust_embed::RustEmbed;
|
||||
#[exclude = "*.DS_Store"]
|
||||
pub struct Assets;
|
||||
|
||||
/// Coop's bundled assets, with the GPUI Kit component icon bundle (Lucide) as
|
||||
/// the fallback so `IconName` SVGs resolve alongside coop's own files.
|
||||
pub struct CombinedAssets;
|
||||
|
||||
impl AssetSource for CombinedAssets {
|
||||
fn load(&self, path: &str) -> Result<Option<std::borrow::Cow<'static, [u8]>>> {
|
||||
if let Some(data) = Assets.load(path)? {
|
||||
return Ok(Some(data));
|
||||
}
|
||||
gpui_kit::assets::Assets.load(path)
|
||||
}
|
||||
|
||||
fn list(&self, path: &str) -> Result<Vec<SharedString>> {
|
||||
let mut paths = Assets.list(path)?;
|
||||
paths.extend(gpui_kit::assets::Assets.list(path)?);
|
||||
Ok(paths)
|
||||
}
|
||||
}
|
||||
|
||||
impl AssetSource for Assets {
|
||||
fn load(&self, path: &str) -> Result<Option<std::borrow::Cow<'static, [u8]>>> {
|
||||
Self::get(path)
|
||||
|
||||
Reference in New Issue
Block a user