summaryrefslogtreecommitdiffstats
path: root/winit/src/multi_window/state.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-03-08 14:00:28 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-08 14:00:28 +0100
commitedf7d7ca7593f660f4b15f154257471c26df87de (patch)
tree7cee3cbfbeb2ae5145f1bf6087b61fce4cbed8c9 /winit/src/multi_window/state.rs
parent2074757cdc65ec16eeb1c7a12a5ff3bb5ed00859 (diff)
parent8919f2593e39f76b273513e959fa6d5ffb78fde2 (diff)
downloadiced-edf7d7ca7593f660f4b15f154257471c26df87de.tar.gz
iced-edf7d7ca7593f660f4b15f154257471c26df87de.tar.bz2
iced-edf7d7ca7593f660f4b15f154257471c26df87de.zip
Merge pull request #2312 from iced-rs/theming-reloaded
Theming reloaded
Diffstat (limited to 'winit/src/multi_window/state.rs')
-rw-r--r--winit/src/multi_window/state.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/winit/src/multi_window/state.rs b/winit/src/multi_window/state.rs
index 2e97a13d..dfd8e696 100644
--- a/winit/src/multi_window/state.rs
+++ b/winit/src/multi_window/state.rs
@@ -2,18 +2,16 @@ use crate::conversion;
use crate::core::{mouse, window};
use crate::core::{Color, Size};
use crate::graphics::Viewport;
-use crate::multi_window::Application;
-use crate::style::application;
+use crate::multi_window::{self, Application};
use std::fmt::{Debug, Formatter};
-use iced_style::application::StyleSheet;
use winit::event::{Touch, WindowEvent};
use winit::window::Window;
/// The state of a multi-windowed [`Application`].
pub struct State<A: Application>
where
- A::Theme: application::StyleSheet,
+ A::Theme: multi_window::DefaultStyle,
{
title: String,
scale_factor: f64,
@@ -22,12 +20,12 @@ where
cursor_position: Option<winit::dpi::PhysicalPosition<f64>>,
modifiers: winit::keyboard::ModifiersState,
theme: A::Theme,
- appearance: application::Appearance,
+ appearance: multi_window::Appearance,
}
impl<A: Application> Debug for State<A>
where
- A::Theme: application::StyleSheet,
+ A::Theme: multi_window::DefaultStyle,
{
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("multi_window::State")
@@ -43,7 +41,7 @@ where
impl<A: Application> State<A>
where
- A::Theme: application::StyleSheet,
+ A::Theme: multi_window::DefaultStyle,
{
/// Creates a new [`State`] for the provided [`Application`]'s `window`.
pub fn new(
@@ -54,7 +52,7 @@ where
let title = application.title(window_id);
let scale_factor = application.scale_factor(window_id);
let theme = application.theme(window_id);
- let appearance = theme.appearance(&application.style());
+ let appearance = application.style(&theme);
let viewport = {
let physical_size = window.inner_size();
@@ -236,6 +234,6 @@ where
// Update theme and appearance
self.theme = application.theme(window_id);
- self.appearance = self.theme.appearance(&application.style());
+ self.appearance = application.style(&self.theme);
}
}