Derive icon paths (#17816)

This PR improves adding and working with icons by using the new
`DerivePathStr` to derive icon paths.

This means paths no longer need to be manually specified, and the
`IconName` and file name will always be consistent between icons.

This PR does not do any work to standardize icons visually, remove
unused icons, or any other such cleanup.

Release Notes:

- N/A
This commit is contained in:
Nate Butler authored and GitHub committed 2024-09-13 21:12:29 -04:00
1 parent 49fb634096
commit cabc6bce5f
39 files changed
+96 -226

No files matched your search

+5 -9
View File
@@ -311,15 +311,11 @@ impl Render for LanguageServerPrompt {
.mt(px(-2.0))
.map(|icon| {
if severity == DiagnosticSeverity::ERROR {
icon.path(
IconName::ExclamationTriangle.path(),
)
.text_color(Color::Error.color(cx))
icon.path(IconName::Warning.path())
.text_color(Color::Error.color(cx))
} else {
icon.path(
IconName::ExclamationTriangle.path(),
)
.text_color(Color::Warning.color(cx))
icon.path(IconName::Warning.path())
.text_color(Color::Warning.color(cx))
}
})
}),
@@ -421,7 +417,7 @@ impl Render for ErrorMessagePrompt {
.mr_2()
.mt(px(-2.0))
.map(|icon| {
icon.path(IconName::ExclamationTriangle.path())
icon.path(IconName::Warning.path())
.text_color(Color::Error.color(cx))
}),
)