Primitives · Icon::from_path draws an application's SVG with the theme's size and color; a path the asset source lacks fails at render
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f02c82c6a
commit
2fb505ee98
9 files changed
+145
-17
No files matched your search
@@ -14,6 +14,7 @@ use gpui::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
assets::CUSTOM_ICON,
|
||||
probe::probe,
|
||||
ui::{UNREAD, blocked, code, picture, row, section, specimen, specimens},
|
||||
};
|
||||
@@ -44,7 +45,7 @@ pub fn icon(cx: &App) -> impl IntoElement + use<> {
|
||||
];
|
||||
section(
|
||||
"Icon",
|
||||
"Lucide, drawn as a mask. Color comes from the theme.",
|
||||
"Bundled Lucide or an application's SVG asset, drawn as a themed mask.",
|
||||
cx,
|
||||
)
|
||||
.child(specimens().children(
|
||||
@@ -55,6 +56,15 @@ pub fn icon(cx: &App) -> impl IntoElement + use<> {
|
||||
specimen(name, Icon::new(IconName::CircleCheck).color(color), cx)
|
||||
})),
|
||||
)
|
||||
.child(
|
||||
specimens().child(specimen(
|
||||
"custom SVG",
|
||||
Icon::from_path(CUSTOM_ICON)
|
||||
.size(IconSize::Xl)
|
||||
.color(colors.accent),
|
||||
cx,
|
||||
)),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn icon_set(cx: &App) -> impl IntoElement + use<> {
|
||||
|
||||
Reference in new issue
Block a user