summaryrefslogtreecommitdiffstats
path: root/winit/src/application/state.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-06 21:27:03 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-06 21:27:03 +0100
commit7c4bf70023a8092faad9630c2c87fbf41bd6ab76 (patch)
treea02aa7fa62276e4e9b870f4f88ba448c0a264e2b /winit/src/application/state.rs
parent34e7c6593a9e0f56cee5db18b7258717cf6bc11b (diff)
downloadiced-7c4bf70023a8092faad9630c2c87fbf41bd6ab76.tar.gz
iced-7c4bf70023a8092faad9630c2c87fbf41bd6ab76.tar.bz2
iced-7c4bf70023a8092faad9630c2c87fbf41bd6ab76.zip
Simplify theming for `Application`
Diffstat (limited to 'winit/src/application/state.rs')
-rw-r--r--winit/src/application/state.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/winit/src/application/state.rs b/winit/src/application/state.rs
index c17a3bcc..b3bdb3a3 100644
--- a/winit/src/application/state.rs
+++ b/winit/src/application/state.rs
@@ -1,4 +1,4 @@
-use crate::application::{self, StyleSheet as _};
+use crate::application;
use crate::conversion;
use crate::core::mouse;
use crate::core::{Color, Size};
@@ -14,7 +14,7 @@ use winit::window::Window;
#[allow(missing_debug_implementations)]
pub struct State<A: Application>
where
- A::Theme: application::StyleSheet,
+ application::Style<A::Theme>: Default,
{
title: String,
scale_factor: f64,
@@ -29,14 +29,14 @@ where
impl<A: Application> State<A>
where
- A::Theme: application::StyleSheet,
+ application::Style<A::Theme>: Default,
{
/// Creates a new [`State`] for the provided [`Application`] and window.
pub fn new(application: &A, window: &Window) -> Self {
let title = application.title();
let scale_factor = application.scale_factor();
let theme = application.theme();
- let appearance = theme.appearance(&application.style());
+ let appearance = application.style(&theme);
let viewport = {
let physical_size = window.inner_size();
@@ -216,6 +216,6 @@ where
// Update theme and appearance
self.theme = application.theme();
- self.appearance = self.theme.appearance(&application.style());
+ self.appearance = application.style(&self.theme);
}
}