Add an animation to the LSP checking indicator (#9463)

Spinner go spinny.

Extra thanks to @kvark for helping me with the shaders.



https://github.com/zed-industries/zed/assets/2280405/9d5f4f4e-0d43-44d2-a089-5d69939938e9


Release Notes:

- Added a spinning animation to the LSP checking indicator

---------

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
This commit is contained in:
Mikayla Maki 2024-03-19 10:16:18 -07:00 committed by GitHub
parent 56bd96bc64
commit fd0071f2af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 708 additions and 32 deletions

View file

@ -1,8 +1,10 @@
use std::time::Duration;
use collections::HashSet;
use editor::Editor;
use gpui::{
rems, EventEmitter, IntoElement, ParentElement, Render, Styled, Subscription, View,
ViewContext, WeakView,
percentage, rems, Animation, AnimationExt, EventEmitter, IntoElement, ParentElement, Render,
Styled, Subscription, Transformation, View, ViewContext, WeakView,
};
use language::Diagnostic;
use lsp::LanguageServerId;
@ -66,7 +68,17 @@ impl Render for DiagnosticIndicator {
Some(
h_flex()
.gap_2()
.child(Icon::new(IconName::ArrowCircle).size(IconSize::Small))
.child(
Icon::new(IconName::ArrowCircle)
.size(IconSize::Small)
.with_animation(
"arrow-circle",
Animation::new(Duration::from_secs(2)).repeat(),
|icon, delta| {
icon.transform(Transformation::rotate(percentage(delta)))
},
),
)
.child(
Label::new("Checking…")
.size(LabelSize::Small)