mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
steamline some more command functions
This commit is contained in:
parent
df338334e1
commit
8627d940f4
3 changed files with 39 additions and 44 deletions
|
|
@ -99,26 +99,22 @@ impl Component for HelpComponent {
|
|||
out.clear();
|
||||
}
|
||||
|
||||
out.push(
|
||||
CommandInfo::new(
|
||||
commands::HELP_OPEN,
|
||||
if self.visible {
|
||||
out.push(CommandInfo::new(commands::SCROLL, true, true));
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::CLOSE_POPUP,
|
||||
true,
|
||||
!self.visible,
|
||||
)
|
||||
.order(99),
|
||||
);
|
||||
true,
|
||||
));
|
||||
}
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::SCROLL,
|
||||
true,
|
||||
self.visible,
|
||||
));
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::CLOSE_POPUP,
|
||||
true,
|
||||
self.visible,
|
||||
));
|
||||
if !self.visible || force_all {
|
||||
out.push(
|
||||
CommandInfo::new(commands::HELP_OPEN, true, true)
|
||||
.order(99),
|
||||
);
|
||||
}
|
||||
|
||||
visibility_blocking(self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,28 +75,24 @@ impl Component for InspectCommitComponent {
|
|||
force_all,
|
||||
self.components().as_slice(),
|
||||
);
|
||||
}
|
||||
|
||||
out.push(
|
||||
CommandInfo::new(
|
||||
commands::CLOSE_POPUP,
|
||||
out.push(
|
||||
CommandInfo::new(commands::CLOSE_POPUP, true, true)
|
||||
.order(1),
|
||||
);
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::DIFF_FOCUS_RIGHT,
|
||||
self.can_focus_diff(),
|
||||
!self.diff.focused() || force_all,
|
||||
));
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::DIFF_FOCUS_LEFT,
|
||||
true,
|
||||
self.is_visible(),
|
||||
)
|
||||
.order(1),
|
||||
);
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::DIFF_FOCUS_RIGHT,
|
||||
self.can_focus_diff(),
|
||||
(self.is_visible() && !self.diff.focused()) || force_all,
|
||||
));
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::DIFF_FOCUS_LEFT,
|
||||
true,
|
||||
(self.is_visible() && self.diff.focused()) || force_all,
|
||||
));
|
||||
self.diff.focused() || force_all,
|
||||
));
|
||||
}
|
||||
|
||||
visibility_blocking(self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,13 +38,16 @@ impl Component for StashMsgComponent {
|
|||
out: &mut Vec<CommandInfo>,
|
||||
force_all: bool,
|
||||
) -> CommandBlocking {
|
||||
self.input.commands(out, force_all);
|
||||
if self.is_visible() || force_all {
|
||||
self.input.commands(out, force_all);
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::STASHING_CONFIRM_MSG,
|
||||
true,
|
||||
true,
|
||||
));
|
||||
}
|
||||
|
||||
out.push(CommandInfo::new(
|
||||
commands::STASHING_CONFIRM_MSG,
|
||||
true,
|
||||
self.is_visible() || force_all,
|
||||
));
|
||||
visibility_blocking(self)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue