From bb07d017e8c8e43ac74f66bf649643bebdc5f71d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 8 Jul 2022 20:07:33 +0200 Subject: Add `Style` variant support to `application::StyleSheet` --- src/application.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index b7c8cf9f..d4297eea 100644 --- a/src/application.rs +++ b/src/application.rs @@ -1,7 +1,7 @@ use crate::window; use crate::{Command, Element, Executor, Settings, Subscription}; -pub use iced_native::application::StyleSheet; +pub use iced_native::application::{Appearance, StyleSheet}; /// An interactive cross-platform application. /// @@ -141,10 +141,20 @@ pub trait Application: Sized { fn view(&mut self) -> Element<'_, Self::Message, Self::Theme>; /// Returns the current [`Theme`] of the [`Application`]. + /// + /// [`Theme`]: Self::Theme fn theme(&self) -> Self::Theme { Self::Theme::default() } + /// Returns the current [`Style`] of the [`Theme`]. + /// + /// [`Style`]: ::Style + /// [`Theme`]: Self::Theme + fn style(&self) -> ::Style { + ::Style::default() + } + /// Returns the event [`Subscription`] for the current state of the /// application. /// @@ -260,6 +270,10 @@ where self.0.theme() } + fn style(&self) -> ::Style { + self.0.style() + } + fn mode(&self) -> iced_winit::Mode { match self.0.mode() { window::Mode::Windowed => iced_winit::Mode::Windowed, -- cgit