Skip to content

Commit

Permalink
Add request_repaint call to layout function
Browse files Browse the repository at this point in the history
  • Loading branch information
giannissc committed Nov 21, 2023
2 parents 14f091e + 5b2ead8 commit a11efbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/view/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ impl<T: Send, A> View<T, A> for ProgressBar<T> {
_message: Box<dyn Any>,
_app_state: &mut T,
) -> MessageResult<A> {
MessageResult::Stale(())
MessageResult::Stale(Box::new(()))
}
}
3 changes: 2 additions & 1 deletion src/widget/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl Widget for ProgressBar {
cx.request_paint();
}

fn layout(&mut self, _cx: &mut LayoutCx, bc: &BoxConstraints) -> Size {
fn layout(&mut self, cx: &mut LayoutCx, bc: &BoxConstraints) -> Size {
cx.request_paint();
bc.constrain(Size::new(WIDTH, HEIGHT))
}

Expand Down

0 comments on commit a11efbb

Please sign in to comment.