diff options
author | 2024-01-21 17:56:01 +0100 | |
---|---|---|
committer | 2024-01-21 17:56:01 +0100 | |
commit | 7a50e9e8fbb8d37e53a42c1dd5936b97463ead53 (patch) | |
tree | c0960018f287bcb2043a1752ae85ad0d45e00f21 /winit/src/application/state.rs | |
parent | 545cc909c9f356dd733d273173694db9b8c28594 (diff) | |
download | iced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.tar.gz iced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.tar.bz2 iced-7a50e9e8fbb8d37e53a42c1dd5936b97463ead53.zip |
Convert `Renderer::Theme` to generic `Widget` type
Diffstat (limited to 'winit/src/application/state.rs')
-rw-r--r-- | winit/src/application/state.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winit/src/application/state.rs b/winit/src/application/state.rs index 8c9b20e0..c17a3bcc 100644 --- a/winit/src/application/state.rs +++ b/winit/src/application/state.rs @@ -1,6 +1,5 @@ use crate::application::{self, StyleSheet as _}; use crate::conversion; -use crate::core; use crate::core::mouse; use crate::core::{Color, Size}; use crate::graphics::Viewport; @@ -15,7 +14,7 @@ use winit::window::Window; #[allow(missing_debug_implementations)] pub struct State<A: Application> where - <A::Renderer as core::Renderer>::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { title: String, scale_factor: f64, @@ -23,14 +22,14 @@ where viewport_version: usize, cursor_position: Option<winit::dpi::PhysicalPosition<f64>>, modifiers: winit::keyboard::ModifiersState, - theme: <A::Renderer as core::Renderer>::Theme, + theme: A::Theme, appearance: application::Appearance, application: PhantomData<A>, } impl<A: Application> State<A> where - <A::Renderer as core::Renderer>::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { /// Creates a new [`State`] for the provided [`Application`] and window. pub fn new(application: &A, window: &Window) -> Self { @@ -107,7 +106,7 @@ where } /// Returns the current theme of the [`State`]. - pub fn theme(&self) -> &<A::Renderer as core::Renderer>::Theme { + pub fn theme(&self) -> &A::Theme { &self.theme } |