mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Layout for rust
This commit is contained in:
parent
96a372e45d
commit
907bea3d3b
7 changed files with 122 additions and 30 deletions
|
@ -105,6 +105,9 @@ impl<GraphicsBackend: graphics::GraphicsBackend> MainWindow<GraphicsBackend> {
|
|||
..
|
||||
} => *control_flow = winit::event_loop::ControlFlow::Exit,
|
||||
winit::event::Event::RedrawRequested(_) => {
|
||||
// FIXME: we should do that only if some property change
|
||||
component.compute_layout();
|
||||
|
||||
{
|
||||
let mut rendering_primitives_builder =
|
||||
graphics_backend.new_rendering_primitives_builder();
|
||||
|
@ -124,8 +127,6 @@ impl<GraphicsBackend: graphics::GraphicsBackend> MainWindow<GraphicsBackend> {
|
|||
let context = EvaluationContext { component: component };
|
||||
let mut frame =
|
||||
graphics_backend.new_frame(size.width, size.height, &Color::WHITE);
|
||||
// FIXME: we should do that only if some property change
|
||||
component.compute_layout();
|
||||
render_function(component, &context, &mut frame, &mut rendering_cache);
|
||||
graphics_backend.present_frame(frame);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue