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_panel: Add hover state to latest commit button (#46046)

Danilo Leal8ef900ce5b8a
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index c2ab62810b4..c016562866f 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -4367,23 +4367,24 @@ impl GitPanel {
Some(
h_flex()
- .py_1p5()
- .px_2()
+ .p_1p5()
.gap_1p5()
.justify_between()
.border_t_1()
.border_color(cx.theme().colors().border.opacity(0.8))
.child(
div()
+ .id("commit-msg-hover")
+ .px_1()
.cursor_pointer()
- .overflow_hidden()
.line_clamp(1)
+ .rounded_sm()
+ .hover(|s| s.bg(cx.theme().colors().element_hover))
.child(
Label::new(commit.subject.clone())
.size(LabelSize::Small)
.truncate(),
)
- .id("commit-msg-hover")
.on_click({
let commit = commit.clone();
let repo = active_repository.downgrade();
@@ -4415,7 +4416,7 @@ impl GitPanel {
)
.when(commit.has_parent, |this| {
let has_unstaged = self.has_unstaged_changes();
- this.child(
+ this.pr_2().child(
panel_icon_button("undo", IconName::Undo)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)