From 7a50e9e8fbb8d37e53a42c1dd5936b97463ead53 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 21 Jan 2024 17:56:01 +0100 Subject: Convert `Renderer::Theme` to generic `Widget` type --- winit/src/application/state.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'winit/src/application/state.rs') 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 where - ::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { title: String, scale_factor: f64, @@ -23,14 +22,14 @@ where viewport_version: usize, cursor_position: Option>, modifiers: winit::keyboard::ModifiersState, - theme: ::Theme, + theme: A::Theme, appearance: application::Appearance, application: PhantomData, } impl State where - ::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) -> &::Theme { + pub fn theme(&self) -> &A::Theme { &self.theme } -- cgit