diff options
author | Shav Kinderlehrer <[email protected]> | 2024-03-07 02:05:03 -0500 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2024-03-07 02:05:03 -0500 |
commit | fa3e812a301455c7bc7b4d829a7fba01ddaea413 (patch) | |
tree | a7f5c2b3b500c8780b6460f6d1107965680f7148 /src/components/hello_world.rs | |
parent | c2acb446e7868b67e5743d54cee5c64c469e5a18 (diff) | |
download | molehole-fa3e812a301455c7bc7b4d829a7fba01ddaea413.tar.gz molehole-fa3e812a301455c7bc7b4d829a7fba01ddaea413.zip |
Implement keyboard shortcut popup
Diffstat (limited to 'src/components/hello_world.rs')
-rw-r--r-- | src/components/hello_world.rs | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/components/hello_world.rs b/src/components/hello_world.rs index 2e3a2ee..ac9d02b 100644 --- a/src/components/hello_world.rs +++ b/src/components/hello_world.rs @@ -1,9 +1,7 @@ -use ratatui::prelude::*; -use ratatui::widgets::Paragraph; +use ratatui::prelude::{Frame, Rect}; +use ratatui::widgets::{Paragraph, Wrap}; -use crate::app_action::AppAction; use crate::component::Component; -use crate::keys::key_commands::*; #[derive(Default, Clone)] pub struct HelloWorld { @@ -16,17 +14,11 @@ impl Component for HelloWorld { Ok(()) } - fn handle_key_event( - &mut self, - key: crossterm::event::KeyEvent, - ) -> eyre::Result<Option<AppAction>> { - self.text = serialize_key_event(key); - Ok(None) - } - fn render(&mut self, frame: &mut Frame, rect: Rect) -> eyre::Result<()> { - - frame.render_widget(Paragraph::new(self.text.clone()), rect); + frame.render_widget( + Paragraph::new(self.text.clone()).wrap(Wrap { trim: true }), + rect, + ); Ok(()) } |