From ceb02f4a36769c488c2525db2fb73f092a6c2706 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 11 Nov 2019 05:26:08 +0100 Subject: Implement `Container` widget Remove `align_self` and `justify_content` methods --- winit/src/application.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index 4deffecc..fdd659d9 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -1,12 +1,13 @@ use crate::{ - column, conversion, + conversion, input::{keyboard, mouse}, renderer::{Target, Windowed}, - Cache, Column, Debug, Element, Event, Length, MouseCursor, UserInterface, + Cache, Container, Debug, Element, Event, Length, MouseCursor, + UserInterface, }; pub trait Application { - type Renderer: Windowed + column::Renderer; + type Renderer: Windowed; type Message: std::fmt::Debug; @@ -282,9 +283,8 @@ where let view = application.view(); debug.view_finished(); - Column::new() + Container::new(view) .width(Length::Units(size.width.round() as u16)) .height(Length::Units(size.height.round() as u16)) - .push(view) .into() } -- cgit From 860a6923bbed57a21ce4b2cae331f6a3a51ca3fe Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 11 Nov 2019 06:07:31 +0100 Subject: Split text measurements cache from rendering cache This speeds up layouting in the most common scenario considerably! :tada: --- winit/src/application.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index fdd659d9..331bafa0 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -61,7 +61,7 @@ pub trait Application { let user_interface = UserInterface::build( document(&mut self, size, &mut debug), Cache::default(), - &renderer, + &mut renderer, ); debug.layout_finished(); @@ -87,7 +87,7 @@ pub trait Application { let mut user_interface = UserInterface::build( document(&mut self, size, &mut debug), cache.take().unwrap(), - &renderer, + &mut renderer, ); debug.layout_finished(); @@ -130,7 +130,7 @@ pub trait Application { let user_interface = UserInterface::build( document(&mut self, size, &mut debug), temp_cache, - &renderer, + &mut renderer, ); debug.layout_finished(); -- cgit