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:
parent
ce848375fe
commit
e8a2dd92c8
39 changed files with 96 additions and 226 deletions
|
@ -667,7 +667,7 @@ impl Item for ProjectDiagnosticsEditor {
|
|||
then.child(
|
||||
h_flex()
|
||||
.gap_1()
|
||||
.child(Icon::new(IconName::ExclamationTriangle).color(Color::Warning))
|
||||
.child(Icon::new(IconName::Warning).color(Color::Warning))
|
||||
.child(
|
||||
Label::new(self.summary.warning_count.to_string())
|
||||
.color(params.text_color()),
|
||||
|
@ -804,7 +804,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
|
|||
icon.path(IconName::XCircle.path())
|
||||
.text_color(Color::Error.color(cx))
|
||||
} else {
|
||||
icon.path(IconName::ExclamationTriangle.path())
|
||||
icon.path(IconName::Warning.path())
|
||||
.text_color(Color::Warning.color(cx))
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -30,7 +30,7 @@ impl Render for DiagnosticIndicator {
|
|||
(0, warning_count) => h_flex()
|
||||
.gap_1()
|
||||
.child(
|
||||
Icon::new(IconName::ExclamationTriangle)
|
||||
Icon::new(IconName::Warning)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Warning),
|
||||
)
|
||||
|
@ -52,7 +52,7 @@ impl Render for DiagnosticIndicator {
|
|||
)
|
||||
.child(Label::new(error_count.to_string()).size(LabelSize::Small))
|
||||
.child(
|
||||
Icon::new(IconName::ExclamationTriangle)
|
||||
Icon::new(IconName::Warning)
|
||||
.size(IconSize::Small)
|
||||
.color(Color::Warning),
|
||||
)
|
||||
|
|
|
@ -50,7 +50,7 @@ impl Render for ToolbarControls {
|
|||
)
|
||||
})
|
||||
.child(
|
||||
IconButton::new("toggle-warnings", IconName::ExclamationTriangle)
|
||||
IconButton::new("toggle-warnings", IconName::Warning)
|
||||
.tooltip(move |cx| Tooltip::text(tooltip, cx))
|
||||
.on_click(cx.listener(|this, _, cx| {
|
||||
if let Some(editor) = this.editor() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue