add unlock/exit buttons to home screen
This commit is contained in:
1 parent
b2a7e5759a
commit
3c06f7e536
3 files changed
+112
-6
No files matched your search
@@ -0,0 +1,28 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use gpui_kit::assets::{Assets, icon_assets};
|
||||
use gpui_kit::{AssetSource, Result, SharedString};
|
||||
|
||||
|
||||
// gpui-kit only embeds the icons its own components use, so anything else has to be listed here
|
||||
icon_assets!(CreddyIcons, [LogOut, ShieldCheck]);
|
||||
|
||||
/// Our extra icons, falling back to gpui-kit's defaults.
|
||||
pub struct CreddyAssets;
|
||||
|
||||
impl AssetSource for CreddyAssets {
|
||||
fn load(&self, path: &str) -> Result<Option<Cow<'static, [u8]>>> {
|
||||
match CreddyIcons.load(path)? {
|
||||
Some(bytes) => Ok(Some(bytes)),
|
||||
None => Assets.load(path),
|
||||
}
|
||||
}
|
||||
|
||||
fn list(&self, path: &str) -> Result<Vec<SharedString>> {
|
||||
let mut paths = Assets.list(path)?;
|
||||
paths.extend(CreddyIcons.list(path)?);
|
||||
paths.sort();
|
||||
paths.dedup();
|
||||
Ok(paths)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user