diff options
author | Blaž Hrastnik | 2021-03-03 08:28:50 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-03 08:28:50 +0000 |
commit | a21d96e7293e32c0d20e8548a65fdd31f92b642d (patch) | |
tree | 1421df70e2395ebe8c371e4c7035926101a0939e /helix-term/src/ui/popup.rs | |
parent | 513effd972ccb537510141c795222ba656f039c5 (diff) |
ui: Scrollable popup menu, with scrollbar indicator.
Diffstat (limited to 'helix-term/src/ui/popup.rs')
-rw-r--r-- | helix-term/src/ui/popup.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs index e0f7a5c0..7260a997 100644 --- a/helix-term/src/ui/popup.rs +++ b/helix-term/src/ui/popup.rs @@ -39,6 +39,10 @@ impl Component for Popup { fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { let key = match event { Event::Key(event) => event, + Event::Resize(width, height) => { + // TODO: calculate inner area, call component's handle_event with that area + return EventResult::Ignored; + } _ => return EventResult::Ignored, }; @@ -63,6 +67,7 @@ impl Component for Popup { // for some events, we want to process them but send ignore, specifically all input except // tab/enter/ctrl-k or whatever will confirm the selection/ ctrl-n/ctrl-p for scroll. } + fn render(&self, viewport: Rect, surface: &mut Surface, cx: &mut Context) { use tui::text::Text; use tui::widgets::{Paragraph, Widget, Wrap}; |