Use same commit button text in panel and modal (#25988)
Release Notes: - Fixed inconsistencies in commit button text between Git panel and modal.
This commit is contained in:
parent
74fc52d5ce
commit
88940732ca
2 changed files with 10 additions and 10 deletions
|
@ -267,11 +267,7 @@ impl CommitModal {
|
||||||
} else {
|
} else {
|
||||||
"Commit changes to tracked files"
|
"Commit changes to tracked files"
|
||||||
};
|
};
|
||||||
let title = if git_panel.has_staged_changes() {
|
let title = git_panel.commit_button_title();
|
||||||
"Commit"
|
|
||||||
} else {
|
|
||||||
"Commit All"
|
|
||||||
};
|
|
||||||
let co_authors = git_panel.render_co_authors(cx);
|
let co_authors = git_panel.render_co_authors(cx);
|
||||||
(branch, tooltip, title, co_authors)
|
(branch, tooltip, title, co_authors)
|
||||||
});
|
});
|
||||||
|
|
|
@ -1985,6 +1985,14 @@ impl GitPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn commit_button_title(&self) -> &'static str {
|
||||||
|
if self.has_staged_changes() {
|
||||||
|
"Commit"
|
||||||
|
} else {
|
||||||
|
"Commit Tracked"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn render_footer(
|
pub fn render_footer(
|
||||||
&self,
|
&self,
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
|
@ -1999,11 +2007,7 @@ impl GitPanel {
|
||||||
|
|
||||||
let enable_coauthors = self.render_co_authors(cx);
|
let enable_coauthors = self.render_co_authors(cx);
|
||||||
|
|
||||||
let title = if self.has_staged_changes() {
|
let title = self.commit_button_title();
|
||||||
"Commit"
|
|
||||||
} else {
|
|
||||||
"Commit Tracked"
|
|
||||||
};
|
|
||||||
let editor_focus_handle = self.commit_editor.focus_handle(cx);
|
let editor_focus_handle = self.commit_editor.focus_handle(cx);
|
||||||
|
|
||||||
let branch = active_repo.read(cx).current_branch().cloned();
|
let branch = active_repo.read(cx).current_branch().cloned();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue