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_graph: Add button to open up the commit view (#49910)

Danilo Leal67e63ec087c8
diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs
index 472fbaa6483..37f170ada5e 100644
--- a/crates/git_graph/src/git_graph.rs
+++ b/crates/git_graph/src/git_graph.rs
@@ -1560,6 +1560,17 @@ impl GitGraph {
.vertical_scrollbar_for(&self.changed_files_scroll_handle, window, cx),
),
)
+ .child(Divider::horizontal())
+ .child(
+ h_flex().p_1p5().w_full().child(
+ Button::new("view-commit", "View Commit")
+ .full_width()
+ .style(ButtonStyle::Outlined)
+ .on_click(cx.listener(|this, _, window, cx| {
+ this.open_selected_commit_view(window, cx);
+ })),
+ ),
+ )
.into_any_element()
}