-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
Currently, when SF Symbols are not available (non-macOS platforms or older macOS versions), Icon::render() returns gpui::Empty, which means icons simply don't appear.
Proposed Solution
Add a fallback mechanism that allows specifying an alternative icon source:
// Option 1: Explicit fallback method
Icon::new("star.fill")
.fallback_svg("icons/star.svg")
.with_size(px(24.))
// Option 2: Builder with fallback
Icon::new("star.fill")
.or_svg("icons/star.svg")
.with_size(px(24.))
// Option 3: Automatic mapping via trait
impl SvgFallback for MyIcon {
fn svg_path(&self) -> &'static str {
match self {
Self::Star => "icons/star.svg",
// ...
}
}
}Benefits
- Cross-platform support (Linux, Windows)
- Graceful degradation on older macOS versions
- Better user experience when SF Symbols are unavailable
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels