Create shader function helper in iced_widget

This commit is contained in:
Héctor Ramón Jiménez 2023-11-14 13:25:49 +01:00
parent 280d3736d5
commit 91d7df52cd
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 14 additions and 4 deletions

View file

@ -385,6 +385,17 @@ where
crate::Canvas::new(program)
}
/// Creates a new [`Shader`].
///
/// [`Shader`]: crate::Shader
#[cfg(feature = "wgpu")]
pub fn shader<Message, P>(program: P) -> crate::Shader<Message, P>
where
P: crate::shader::Program<Message>,
{
crate::Shader::new(program)
}
/// Focuses the previous focusable widget.
pub fn focus_previous<Message>() -> Command<Message>
where