Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git_ui: Replace commit message generation spinner with a cancel button (#49540)

Austin Cummings1376130066b7
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 1e53c1cf53e..62f8edcfbd8 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -71,8 +71,8 @@ use strum::{IntoEnumIterator, VariantNames};
use theme_settings::ThemeSettings;
use time::OffsetDateTime;
use ui::{
- ButtonLike, Checkbox, CommonAnimationExt, ContextMenu, ElevationIndex, IndentGuideColors,
- PopoverMenu, RenderedIndentGuide, ScrollAxes, Scrollbars, SplitButton, Tooltip, WithScrollbar,
+ ButtonLike, Checkbox, ContextMenu, ElevationIndex, IndentGuideColors, PopoverMenu,
+ RenderedIndentGuide, ScrollAxes, Scrollbars, SplitButton, TintColor, Tooltip, WithScrollbar,
prelude::*,
};
use util::paths::PathStyle;
@@ -4063,10 +4063,15 @@ impl GitPanel {
h_flex()
.gap_1()
.child(
- Icon::new(IconName::ArrowCircle)
- .size(IconSize::XSmall)
- .color(Color::Info)
- .with_rotate_animation(2),
+ IconButton::new("cancel-generate-commit-message", IconName::Stop)
+ .icon_color(Color::Error)
+ .icon_size(IconSize::Small)
+ .style(ButtonStyle::Tinted(TintColor::Error))
+ .tooltip(Tooltip::text("Cancel Commit Message Generation"))
+ .on_click(cx.listener(|this, _event, _window, cx| {
+ this.generate_commit_message_task.take();
+ cx.notify();
+ })),
)
.child(
Label::new("Generating Commit…")