mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
rename
This commit is contained in:
parent
2282305e7c
commit
6001593a0a
6 changed files with 17 additions and 17 deletions
10
src/app.rs
10
src/app.rs
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ pub struct CommandInfo {
|
|||
|
||||
impl CommandInfo {
|
||||
///
|
||||
pub fn new_new(
|
||||
pub fn new(
|
||||
text: CommandText,
|
||||
enabled: bool,
|
||||
available: bool,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue