Fix layout warnings with timers.
@@ -451,9 +451,13 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
}
// log if we seem not to be laid out when we should be
- if !matches!(event, Event::WindowConnected | Event::WindowSize(_))
- && self.state.layout_rect.is_none()
- {
+ if self.state.layout_rect.is_none() {
+ match event {
+ Event::Internal(_) => (),
+ Event::Timer(_) => (),
+ Event::WindowConnected => (),
+ Event::WindowSize(_) => (),
+ _ => {
log::warn!(
"Widget '{}' received an event ({:?}) without having been laid out. \
This likely indicates a missed call to set_layout_rect.",
@@ -461,6 +465,8 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
event,
);
}
+ }
+ }
// TODO: factor as much logic as possible into monomorphic functions.
if ctx.is_handled {
