diff options
author | 2024-02-10 00:50:49 +0100 | |
---|---|---|
committer | 2024-02-10 00:50:49 +0100 | |
commit | c63529095604ffde00a504ed083474707ab484de (patch) | |
tree | 76a8a103f6352263ccd30a7e230089fbb2d54822 /style | |
parent | 7ee00e751a8fe5cedadeeb478c6f0e7d6a5dc0dc (diff) | |
parent | 0bcdefeb00c899c23bc7b54903df5bcbc644fbb5 (diff) | |
download | iced-c63529095604ffde00a504ed083474707ab484de.tar.gz iced-c63529095604ffde00a504ed083474707ab484de.tar.bz2 iced-c63529095604ffde00a504ed083474707ab484de.zip |
Merge pull request #2231 from Koranir/transparency-fix
Fix alpha mode misconfiguration in wgpu renderer
Diffstat (limited to '')
-rw-r--r-- | style/src/theme.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs index afb4d027..235aecbd 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -172,6 +172,15 @@ pub enum Application { Custom(Box<dyn application::StyleSheet<Style = Theme>>), } +impl Application { + /// Creates a custom [`Application`] style. + pub fn custom( + custom: impl application::StyleSheet<Style = Theme> + 'static, + ) -> Self { + Self::Custom(Box::new(custom)) + } +} + impl application::StyleSheet for Theme { type Style = Application; @@ -196,14 +205,6 @@ impl<T: Fn(&Theme) -> application::Appearance> application::StyleSheet for T { } } -impl<T: Fn(&Theme) -> application::Appearance + 'static> From<T> - for Application -{ - fn from(f: T) -> Self { - Self::Custom(Box::new(f)) - } -} - /// The style of a button. #[derive(Default)] pub enum Button { |