Simplify theming for Application
This commit is contained in:
parent
34e7c6593a
commit
7c4bf70023
14 changed files with 382 additions and 392 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::theme::{self, Theme};
|
||||
use crate::{Application, Command, Element, Error, Settings, Subscription};
|
||||
use crate::application::{self, Application};
|
||||
use crate::{Command, Element, Error, Settings, Subscription, Theme};
|
||||
|
||||
/// A sandboxed [`Application`].
|
||||
///
|
||||
|
|
@ -123,8 +123,8 @@ pub trait Sandbox {
|
|||
/// Returns the current style variant of [`theme::Application`].
|
||||
///
|
||||
/// By default, it returns [`theme::Application::default`].
|
||||
fn style(&self) -> theme::Application {
|
||||
theme::Application::default()
|
||||
fn style(&self, theme: &Theme) -> application::Appearance {
|
||||
crate::shell::application::default(theme)
|
||||
}
|
||||
|
||||
/// Returns the scale factor of the [`Sandbox`].
|
||||
|
|
@ -185,8 +185,8 @@ where
|
|||
T::theme(self)
|
||||
}
|
||||
|
||||
fn style(&self) -> theme::Application {
|
||||
T::style(self)
|
||||
fn style(&self, theme: &Theme) -> application::Appearance {
|
||||
T::style(self, theme)
|
||||
}
|
||||
|
||||
fn subscription(&self) -> Subscription<T::Message> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue