This commit is contained in:
Stephan Dilly 2020-04-03 16:26:05 +02:00
parent 2282305e7c
commit 6001593a0a
6 changed files with 17 additions and 17 deletions

View file

@ -273,7 +273,7 @@ impl App {
let focus_on_stage = self.focus == Focus::Stage;
let focus_not_diff = self.focus != Focus::Diff;
res.push(
CommandInfo::new_new(
CommandInfo::new(
commands::STATUS_FOCUS_UNSTAGED,
true,
main_cmds_available
@ -283,7 +283,7 @@ impl App {
.hidden(),
);
res.push(
CommandInfo::new_new(
CommandInfo::new(
commands::STATUS_FOCUS_STAGED,
true,
main_cmds_available
@ -295,12 +295,12 @@ impl App {
}
{
let focus_on_diff = self.focus == Focus::Diff;
res.push(CommandInfo::new_new(
res.push(CommandInfo::new(
commands::STATUS_FOCUS_LEFT,
true,
main_cmds_available && focus_on_diff,
));
res.push(CommandInfo::new_new(
res.push(CommandInfo::new(
commands::STATUS_FOCUS_RIGHT,
true,
main_cmds_available && !focus_on_diff,
@ -308,7 +308,7 @@ impl App {
}
res.push(
CommandInfo::new_new(
CommandInfo::new(
commands::QUIT,
true,
main_cmds_available,

View file

@ -178,25 +178,25 @@ impl Component for ChangesComponent {
) -> CommandBlocking {
let some_selection = self.selection().is_some();
if self.is_working_dir {
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::STAGE_FILE,
some_selection,
self.focused,
));
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::RESET_FILE,
some_selection,
self.focused,
));
} else {
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::UNSTAGE_FILE,
some_selection,
self.focused,
));
}
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::SCROLL,
self.items.len() > 1,
self.focused,

View file

@ -35,7 +35,7 @@ pub struct CommandInfo {
impl CommandInfo {
///
pub fn new_new(
pub fn new(
text: CommandText,
enabled: bool,
available: bool,

View file

@ -54,17 +54,17 @@ impl Component for CommitComponent {
out: &mut Vec<CommandInfo>,
_force_all: bool,
) -> CommandBlocking {
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::COMMIT_OPEN,
!self.stage_empty,
!self.visible,
));
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::COMMIT_ENTER,
self.can_commit(),
self.visible,
));
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::CLOSE_POPUP,
true,
self.visible,

View file

@ -248,7 +248,7 @@ impl Component for DiffComponent {
out: &mut Vec<CommandInfo>,
_force_all: bool,
) -> CommandBlocking {
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::SCROLL,
self.can_scroll(),
self.focused,

View file

@ -67,7 +67,7 @@ impl Component for HelpComponent {
}
out.push(
CommandInfo::new_new(
CommandInfo::new(
commands::HELP_OPEN,
true,
!self.visible,
@ -75,13 +75,13 @@ impl Component for HelpComponent {
.order(99),
);
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::SCROLL,
true,
self.visible,
));
out.push(CommandInfo::new_new(
out.push(CommandInfo::new(
commands::CLOSE_POPUP,
true,
self.visible,