mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
somehow autocomplete broke and I didnt notice till now, right after a
release :(
This commit is contained in:
parent
a1e1e51b10
commit
24740e9852
@ -95,7 +95,14 @@ impl<T: 'static + Clone> WidgetImpl for Autocomplete<T> {
|
||||
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
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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) {}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -206,7 +206,7 @@ impl<T: Yvalue<T>> WidgetImpl for LinePlot<T> {
|
||||
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);
|
||||
|
@ -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<dyn WidgetImpl>) {
|
||||
fn restore(&mut self, _: &mut EventCtx, _prev: &Box<dyn WidgetImpl>) {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user