aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/compositor.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-02 09:24:24 +0000
committerBlaž Hrastnik2021-03-02 09:24:24 +0000
commit0b85c16be91d9326876b2e4a1ae6bdc1381d700d (patch)
tree4bbb758097d6b3aecb8791b061bd49a59dc5ad7a /helix-term/src/compositor.rs
parent11c4e0b05325d8fd8046a764ec4b9e655486313d (diff)
ui: Share popup code with menu.
Menu is now just wrapped in a popup.
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 59e93e03..3c90b76a 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -44,7 +44,9 @@ pub struct Context<'a> {
pub trait Component {
/// Process input events, return true if handled.
- fn handle_event(&mut self, event: Event, ctx: &mut Context) -> EventResult;
+ fn handle_event(&mut self, event: Event, ctx: &mut Context) -> EventResult {
+ EventResult::Ignored
+ }
// , args: ()
/// Should redraw? Useful for saving redraw cycles if we know component didn't change.
@@ -57,6 +59,10 @@ pub trait Component {
fn cursor_position(&self, area: Rect, ctx: &Editor) -> Option<Position> {
None
}
+
+ fn size_hint(&self, area: Rect) -> Option<(usize, usize)> {
+ None
+ }
}
// For v1: