Added help footers

This commit is contained in:
veeso
2022-01-06 10:44:34 +01:00
committed by Christian Visintin
parent 2a3d4f2670
commit a93dbde0c8
11 changed files with 130 additions and 53 deletions
+9 -2
View File
@@ -44,7 +44,7 @@ pub use popup::{
ErrorPopup, InfoPopup, InstallUpdatePopup, Keybindings, QuitPopup, ReleaseNotes, WaitPopup,
WindowSizeError,
};
pub use text::{HelpText, NewVersionDisclaimer, Subtitle, Title};
pub use text::{HelpFooter, NewVersionDisclaimer, Subtitle, Title};
use tui_realm_stdlib::Phantom;
use tuirealm::event::{Event, Key, KeyEvent, KeyModifiers, NoUserEvent};
@@ -60,7 +60,10 @@ pub struct GlobalListener {
impl Component<Msg, NoUserEvent> for GlobalListener {
fn on(&mut self, ev: Event<NoUserEvent>) -> Option<Msg> {
match ev {
Event::Keyboard(KeyEvent { code: Key::Esc, .. }) => Some(Msg::ShowQuitPopup),
Event::Keyboard(KeyEvent {
code: Key::Esc | Key::Function(10),
..
}) => Some(Msg::ShowQuitPopup),
Event::Keyboard(KeyEvent {
code: Key::Char('c'),
modifiers: KeyModifiers::CONTROL,
@@ -69,6 +72,10 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
code: Key::Char('h'),
modifiers: KeyModifiers::CONTROL,
}) => Some(Msg::ShowKeybindingsPopup),
Event::Keyboard(KeyEvent {
code: Key::Function(1),
..
}) => Some(Msg::ShowKeybindingsPopup),
Event::Keyboard(KeyEvent {
code: Key::Char('r'),
modifiers: KeyModifiers::CONTROL,