Use custom Application::style to enable transparency
This commit is contained in:
parent
712c8e53f2
commit
81bed94148
2 changed files with 28 additions and 27 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue