summaryrefslogtreecommitdiffstats
path: root/src/sandbox.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 /src/sandbox.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 'src/sandbox.rs')
-rw-r--r--src/sandbox.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sandbox.rs b/src/sandbox.rs
index 28461929..568b673e 100644
--- a/src/sandbox.rs
+++ b/src/sandbox.rs
@@ -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`].
///
@@ -120,11 +120,11 @@ pub trait Sandbox {
Theme::default()
}
- /// Returns the current style variant of [`theme::Application`].
- ///
- /// By default, it returns [`theme::Application::default`].
- fn style(&self) -> theme::Application {
- theme::Application::default()
+ /// Returns the current [`application::Appearance`].
+ fn style(&self, theme: &Theme) -> application::Appearance {
+ use application::DefaultStyle;
+
+ theme.default_style()
}
/// 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> {