From 24740e9852ac77636704e26aebfe7ad5f493b408 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Sun, 26 Jul 2020 20:49:16 -0700 Subject: [PATCH] somehow autocomplete broke and I didnt notice till now, right after a release :( --- ezgui/src/widgets/autocomplete.rs | 9 ++++++++- ezgui/src/widgets/compare_times.rs | 2 +- ezgui/src/widgets/containers.rs | 2 +- ezgui/src/widgets/fan_chart.rs | 2 +- ezgui/src/widgets/filler.rs | 2 +- ezgui/src/widgets/just_draw.rs | 4 ++-- ezgui/src/widgets/line_plot.rs | 2 +- ezgui/src/widgets/mod.rs | 2 +- ezgui/src/widgets/scatter_plot.rs | 2 +- ezgui/src/widgets/slider.rs | 4 ++-- ezgui/src/widgets/text_box.rs | 2 +- 11 files changed, 20 insertions(+), 13 deletions(-) diff --git a/ezgui/src/widgets/autocomplete.rs b/ezgui/src/widgets/autocomplete.rs index aa763fbb1c..078e6247c0 100644 --- a/ezgui/src/widgets/autocomplete.rs +++ b/ezgui/src/widgets/autocomplete.rs @@ -95,7 +95,14 @@ impl WidgetImpl for Autocomplete { self.recalc_menu(ctx); output.redo_layout = true; } else { - self.menu.event(ctx, output); + // Don't let the menu fill out the real outcome. + self.menu.event( + ctx, + &mut WidgetOutput { + redo_layout: false, + outcome: None, + }, + ); match self.menu.state { InputResult::StillActive => {} // Ignore this and make sure the Composite has a quit control diff --git a/ezgui/src/widgets/compare_times.rs b/ezgui/src/widgets/compare_times.rs index 3a7a17a453..62e802b309 100644 --- a/ezgui/src/widgets/compare_times.rs +++ b/ezgui/src/widgets/compare_times.rs @@ -140,7 +140,7 @@ impl WidgetImpl for CompareTimes { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); diff --git a/ezgui/src/widgets/containers.rs b/ezgui/src/widgets/containers.rs index 1e0daca70b..2c5f2a7224 100644 --- a/ezgui/src/widgets/containers.rs +++ b/ezgui/src/widgets/containers.rs @@ -11,7 +11,7 @@ impl WidgetImpl for Nothing { unreachable!() } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) { + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) { unreachable!() } fn draw(&self, _g: &mut GfxCtx) { diff --git a/ezgui/src/widgets/fan_chart.rs b/ezgui/src/widgets/fan_chart.rs index 7f99b3c5bc..91f3a911b8 100644 --- a/ezgui/src/widgets/fan_chart.rs +++ b/ezgui/src/widgets/fan_chart.rs @@ -187,7 +187,7 @@ impl WidgetImpl for FanChart { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); diff --git a/ezgui/src/widgets/filler.rs b/ezgui/src/widgets/filler.rs index 7af0ec70b8..e398a7d807 100644 --- a/ezgui/src/widgets/filler.rs +++ b/ezgui/src/widgets/filler.rs @@ -25,6 +25,6 @@ impl WidgetImpl for Filler { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, _g: &mut GfxCtx) {} } diff --git a/ezgui/src/widgets/just_draw.rs b/ezgui/src/widgets/just_draw.rs index 3e5c05716e..0bce1acc06 100644 --- a/ezgui/src/widgets/just_draw.rs +++ b/ezgui/src/widgets/just_draw.rs @@ -59,7 +59,7 @@ impl WidgetImpl for JustDraw { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); @@ -94,7 +94,7 @@ impl WidgetImpl for DrawWithTooltips { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); diff --git a/ezgui/src/widgets/line_plot.rs b/ezgui/src/widgets/line_plot.rs index 6134575285..a0f28d8708 100644 --- a/ezgui/src/widgets/line_plot.rs +++ b/ezgui/src/widgets/line_plot.rs @@ -206,7 +206,7 @@ impl> WidgetImpl for LinePlot { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); diff --git a/ezgui/src/widgets/mod.rs b/ezgui/src/widgets/mod.rs index e6dc182a4d..809b049b43 100644 --- a/ezgui/src/widgets/mod.rs +++ b/ezgui/src/widgets/mod.rs @@ -37,7 +37,7 @@ pub trait WidgetImpl: downcast_rs::Downcast { } /// Restore state from the previous version of this widget, with the same ID. Implementors must /// downcast. - fn restore(&mut self, _ctx: &mut EventCtx, _prev: &Box) { + fn restore(&mut self, _: &mut EventCtx, _prev: &Box) { unreachable!() } } diff --git a/ezgui/src/widgets/scatter_plot.rs b/ezgui/src/widgets/scatter_plot.rs index baf689d9eb..97a8295416 100644 --- a/ezgui/src/widgets/scatter_plot.rs +++ b/ezgui/src/widgets/scatter_plot.rs @@ -186,7 +186,7 @@ impl WidgetImpl for ScatterPlot { self.top_left = top_left; } - fn event(&mut self, _ctx: &mut EventCtx, _output: &mut WidgetOutput) {} + fn event(&mut self, _: &mut EventCtx, _: &mut WidgetOutput) {} fn draw(&self, g: &mut GfxCtx) { g.redraw_at(self.top_left, &self.draw); diff --git a/ezgui/src/widgets/slider.rs b/ezgui/src/widgets/slider.rs index c95e1c2962..8a6a38a719 100644 --- a/ezgui/src/widgets/slider.rs +++ b/ezgui/src/widgets/slider.rs @@ -204,7 +204,7 @@ impl WidgetImpl for Slider { self.top_left = top_left; } - fn event(&mut self, ctx: &mut EventCtx, _output: &mut WidgetOutput) { + fn event(&mut self, ctx: &mut EventCtx, _: &mut WidgetOutput) { if self.inner_event(ctx) { self.recalc(ctx); } @@ -371,7 +371,7 @@ impl WidgetImpl for AreaSlider { self.top_left = top_left; } - fn event(&mut self, ctx: &mut EventCtx, _output: &mut WidgetOutput) { + fn event(&mut self, ctx: &mut EventCtx, _: &mut WidgetOutput) { if self.inner_event(ctx) { self.recalc(ctx); } diff --git a/ezgui/src/widgets/text_box.rs b/ezgui/src/widgets/text_box.rs index c759185575..8f952916f6 100644 --- a/ezgui/src/widgets/text_box.rs +++ b/ezgui/src/widgets/text_box.rs @@ -63,7 +63,7 @@ impl WidgetImpl for TextBox { self.top_left = top_left; } - fn event(&mut self, ctx: &mut EventCtx, _output: &mut WidgetOutput) { + fn event(&mut self, ctx: &mut EventCtx, _: &mut WidgetOutput) { if ctx.redo_mouseover() { if let Some(pt) = ctx.canvas.get_cursor_in_screen_space() { self.hovering = ScreenRectangle::top_left(self.top_left, self.dims).contains(pt);