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/multi_window/state.rs | 11 +++++------ winit/src/multi_window/window_manager.rs | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'winit/src/multi_window') diff --git a/winit/src/multi_window/state.rs b/winit/src/multi_window/state.rs index 235771f4..2e97a13d 100644 --- a/winit/src/multi_window/state.rs +++ b/winit/src/multi_window/state.rs @@ -1,5 +1,4 @@ use crate::conversion; -use crate::core; use crate::core::{mouse, window}; use crate::core::{Color, Size}; use crate::graphics::Viewport; @@ -14,7 +13,7 @@ use winit::window::Window; /// The state of a multi-windowed [`Application`]. pub struct State where - ::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { title: String, scale_factor: f64, @@ -22,13 +21,13 @@ where viewport_version: u64, cursor_position: Option>, modifiers: winit::keyboard::ModifiersState, - theme: ::Theme, + theme: A::Theme, appearance: application::Appearance, } impl Debug for State where - ::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("multi_window::State") @@ -44,7 +43,7 @@ where impl State where - ::Theme: application::StyleSheet, + A::Theme: application::StyleSheet, { /// Creates a new [`State`] for the provided [`Application`]'s `window`. pub fn new( @@ -124,7 +123,7 @@ where } /// Returns the current theme of the [`State`]. - pub fn theme(&self) -> &::Theme { + pub fn theme(&self) -> &A::Theme { &self.theme } diff --git a/winit/src/multi_window/window_manager.rs b/winit/src/multi_window/window_manager.rs index 9e15f9ea..23f3c0ba 100644 --- a/winit/src/multi_window/window_manager.rs +++ b/winit/src/multi_window/window_manager.rs @@ -12,7 +12,7 @@ use winit::monitor::MonitorHandle; #[allow(missing_debug_implementations)] pub struct WindowManager where - ::Theme: StyleSheet, + A::Theme: StyleSheet, C: Compositor, { aliases: BTreeMap, @@ -23,7 +23,7 @@ impl WindowManager where A: Application, C: Compositor, - ::Theme: StyleSheet, + A::Theme: StyleSheet, { pub fn new() -> Self { Self { @@ -109,7 +109,7 @@ impl Default for WindowManager where A: Application, C: Compositor, - ::Theme: StyleSheet, + A::Theme: StyleSheet, { fn default() -> Self { Self::new() @@ -121,7 +121,7 @@ pub struct Window where A: Application, C: Compositor, - ::Theme: StyleSheet, + A::Theme: StyleSheet, { pub raw: Arc, pub state: State, @@ -136,7 +136,7 @@ impl Window where A: Application, C: Compositor, - ::Theme: StyleSheet, + A::Theme: StyleSheet, { pub fn position(&self) -> Option { self.raw -- cgit