@@ -4478,10 +4478,10 @@ impl GitPanel {
.child(
div()
.id("commit-msg-hover")
- .px_1()
.cursor_pointer()
- .line_clamp(1)
+ .px_1()
.rounded_sm()
+ .line_clamp(1)
.hover(|s| s.bg(cx.theme().colors().element_hover))
.child(
Label::new(commit.subject.clone())
@@ -4517,42 +4517,46 @@ impl GitPanel {
}
}),
)
- .when(commit.has_parent, |this| {
- let has_unstaged = self.has_unstaged_changes();
- this.pr_2().child(
- h_flex().gap_1().child(
- panel_icon_button("undo", IconName::Undo)
- .icon_size(IconSize::XSmall)
- .icon_color(Color::Muted)
- .tooltip(move |_window, cx| {
- Tooltip::with_meta(
- "Uncommit",
- Some(&git::Uncommit),
- if has_unstaged {
- "git reset HEAD^ --soft"
- } else {
- "git reset HEAD^"
- },
- cx,
- )
- })
- .on_click(
- cx.listener(|this, _, window, cx| this.uncommit(window, cx)),
- ),
- ),
- )
- })
- .when(window.is_action_available(&Open, cx), |this| {
- this.child(
- panel_icon_button("git-graph-button", IconName::ListTree)
- .icon_size(IconSize::XSmall)
- .icon_color(Color::Muted)
- .tooltip(|_window, cx| Tooltip::for_action("Open Git Graph", &Open, cx))
- .on_click(|_, window, cx| {
- window.dispatch_action(Open.boxed_clone(), cx)
- }),
- )
- }),
+ .child(
+ h_flex()
+ .gap_0p5()
+ .when(commit.has_parent, |this| {
+ let has_unstaged = self.has_unstaged_changes();
+ this.child(
+ panel_icon_button("undo", IconName::Undo)
+ .icon_size(IconSize::Small)
+ .tooltip(move |_window, cx| {
+ Tooltip::with_meta(
+ "Uncommit",
+ Some(&git::Uncommit),
+ if has_unstaged {
+ "git reset HEAD^ --soft"
+ } else {
+ "git reset HEAD^"
+ },
+ cx,
+ )
+ })
+ .on_click(
+ cx.listener(|this, _, window, cx| {
+ this.uncommit(window, cx)
+ }),
+ ),
+ )
+ })
+ .when(window.is_action_available(&Open, cx), |this| {
+ this.child(
+ panel_icon_button("git-graph-button", IconName::GitGraph)
+ .icon_size(IconSize::Small)
+ .tooltip(|_window, cx| {
+ Tooltip::for_action("Open Git Graph", &Open, cx)
+ })
+ .on_click(|_, window, cx| {
+ window.dispatch_action(Open.boxed_clone(), cx)
+ }),
+ )
+ }),
+ ),
)
}
@@ -142,6 +142,7 @@ pub enum IconName {
GitBranch,
GitBranchAlt,
GitBranchPlus,
+ GitGraph,
Github,
Hash,
HistoryRerun,