From bb07d017e8c8e43ac74f66bf649643bebdc5f71d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 8 Jul 2022 20:07:33 +0200 Subject: Add `Style` variant support to `application::StyleSheet` --- glutin/src/application.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'glutin/src/application.rs') diff --git a/glutin/src/application.rs b/glutin/src/application.rs index a222036a..dddf0067 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -10,6 +10,7 @@ use iced_winit::application; use iced_winit::conversion; use iced_winit::futures; use iced_winit::futures::channel::mpsc; +use iced_winit::renderer; use iced_winit::user_interface; use iced_winit::{Clipboard, Debug, Proxy, Settings}; @@ -212,7 +213,6 @@ async fn run_instance( let mut state = application::State::new(&application, context.window()); let mut viewport_version = state.viewport_version(); - let mut theme = application.theme(); let mut user_interface = ManuallyDrop::new(application::build_user_interface( @@ -278,7 +278,6 @@ async fn run_instance( let should_exit = application.should_exit(); - theme = application.theme(); user_interface = ManuallyDrop::new(application::build_user_interface( &mut application, @@ -296,7 +295,10 @@ async fn run_instance( debug.draw_started(); let new_mouse_interaction = user_interface.draw( &mut renderer, - &theme, + state.theme(), + &renderer::Style { + text_color: state.text_color(), + }, state.cursor_position(), ); debug.draw_finished(); @@ -352,7 +354,10 @@ async fn run_instance( debug.draw_started(); let new_mouse_interaction = user_interface.draw( &mut renderer, - &theme, + state.theme(), + &renderer::Style { + text_color: state.text_color(), + }, state.cursor_position(), ); debug.draw_finished(); @@ -380,7 +385,7 @@ async fn run_instance( compositor.present( &mut renderer, state.viewport(), - theme.background_color(), + state.background_color(), &debug.overlay(), ); -- cgit