From f74ab463d44dd0bb025b0cea466d2861576253dd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 29 Dec 2019 12:29:47 +0100 Subject: Add `background_color` to `Settings` --- winit/src/application.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index a8612b1a..50060b11 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -279,8 +279,12 @@ pub trait Application: Sized { resized = false; } - let new_mouse_cursor = - renderer.draw(&primitive, &debug.overlay(), &mut target); + let new_mouse_cursor = renderer.draw( + settings.background_color, + &primitive, + &debug.overlay(), + &mut target, + ); debug.render_finished(); -- cgit From 89a6b8a9a173e767753ec777fd83c912c1be5ea3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 29 Dec 2019 12:31:47 +0100 Subject: Rename `Settings::background_color` to `background` --- winit/src/application.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index 50060b11..56f17573 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -280,7 +280,7 @@ pub trait Application: Sized { } let new_mouse_cursor = renderer.draw( - settings.background_color, + settings.background, &primitive, &debug.overlay(), &mut target, -- cgit From fb9cc0262b30a953e8188897b74abb5106ea1fd8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 31 Dec 2019 11:36:54 +0100 Subject: Draft basic styling for `Container` --- winit/src/application.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index 56f17573..02fa3780 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -1,5 +1,5 @@ use crate::{ - conversion, + container, conversion, input::{keyboard, mouse}, renderer::{Target, Windowed}, subscription, Cache, Clipboard, Command, Container, Debug, Element, Event, @@ -18,7 +18,7 @@ pub trait Application: Sized { /// The renderer to use to draw the [`Application`]. /// /// [`Application`]: trait.Application.html - type Renderer: Windowed; + type Renderer: Windowed + container::Renderer; /// The type of __messages__ your [`Application`] will produce. /// -- cgit From d96ced8e2da703117a43399110ef2b8fa21a7546 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 1 Jan 2020 17:49:48 +0100 Subject: Allow configuration of default font --- winit/src/application.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index 02fa3780..d16c209c 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -81,8 +81,10 @@ pub trait Application: Sized { /// It should probably be that last thing you call in your `main` function. /// /// [`Application`]: trait.Application.html - fn run(settings: Settings) - where + fn run( + settings: Settings, + renderer_settings: ::Settings, + ) where Self: 'static, { use winit::{ @@ -140,7 +142,7 @@ pub trait Application: Sized { let mut resized = false; let clipboard = Clipboard::new(&window); - let mut renderer = Self::Renderer::new(); + let mut renderer = Self::Renderer::new(renderer_settings); let mut target = { let (width, height) = to_physical(size, dpi); -- cgit From 8d6f86b317303c06a0daf1ca3ce91c29670dd674 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 5 Jan 2020 18:11:54 +0100 Subject: Remove `background` from `Settings` --- winit/src/application.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index d16c209c..da943660 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -281,12 +281,8 @@ pub trait Application: Sized { resized = false; } - let new_mouse_cursor = renderer.draw( - settings.background, - &primitive, - &debug.overlay(), - &mut target, - ); + let new_mouse_cursor = + renderer.draw(&primitive, &debug.overlay(), &mut target); debug.render_finished(); -- cgit From d15d1156bd0c7fa111d1c59bea11fd58b9cc63b1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 10 Jan 2020 01:34:41 +0100 Subject: Produce `window::Event::Resized` in `iced_winit` --- winit/src/application.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'winit/src/application.rs') diff --git a/winit/src/application.rs b/winit/src/application.rs index da943660..8529c99c 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -2,8 +2,8 @@ use crate::{ container, conversion, input::{keyboard, mouse}, renderer::{Target, Windowed}, - subscription, Cache, Clipboard, Command, Container, Debug, Element, Event, - Length, MouseCursor, Settings, Subscription, UserInterface, + subscription, window, Cache, Clipboard, Command, Container, Debug, Element, + Event, Length, MouseCursor, Settings, Subscription, UserInterface, }; /// An interactive, native cross-platform application. @@ -373,10 +373,13 @@ pub trait Application: Sized { *control_flow = ControlFlow::Exit; } WindowEvent::Resized(new_size) => { + events.push(Event::Window(window::Event::Resized { + width: new_size.width.round() as u32, + height: new_size.height.round() as u32, + })); + size = new_size; resized = true; - - log::debug!("Resized: {:?}", new_size); } _ => {} }, -- cgit