summaryrefslogtreecommitdiffstats
path: root/glutin
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-08 20:07:33 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-08 20:07:33 +0200
commitbb07d017e8c8e43ac74f66bf649643bebdc5f71d (patch)
tree6e780f78ef4eae7dbe590a82ceef11e47289d953 /glutin
parentfa55dff61db47197a961152285c6a6abfab0b217 (diff)
downloadiced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.tar.gz
iced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.tar.bz2
iced-bb07d017e8c8e43ac74f66bf649643bebdc5f71d.zip
Add `Style` variant support to `application::StyleSheet`
Diffstat (limited to 'glutin')
-rw-r--r--glutin/src/application.rs15
1 files changed, 10 insertions, 5 deletions
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<A, E, C>(
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<A, E, C>(
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<A, E, C>(
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<A, E, C>(
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<A, E, C>(
compositor.present(
&mut renderer,
state.viewport(),
- theme.background_color(),
+ state.background_color(),
&debug.overlay(),
);