Implement theme styling for Rule

This commit is contained in:
Héctor Ramón Jiménez 2022-06-01 01:56:46 +02:00
parent 6f69df3d41
commit c275fde67a
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
8 changed files with 86 additions and 123 deletions

View file

@ -202,14 +202,22 @@ pub fn vertical_space(height: Length) -> widget::Space {
/// Creates a horizontal [`Rule`] with the given height.
///
/// [`Rule`]: widget::Rule
pub fn horizontal_rule<'a>(height: u16) -> widget::Rule<'a> {
pub fn horizontal_rule<Renderer>(height: u16) -> widget::Rule<Renderer>
where
Renderer: iced_native::Renderer,
Renderer::Theme: widget::rule::StyleSheet,
{
widget::Rule::horizontal(height)
}
/// Creates a vertical [`Rule`] with the given width.
///
/// [`Rule`]: widget::Rule
pub fn vertical_rule<'a>(width: u16) -> widget::Rule<'a> {
pub fn vertical_rule<Renderer>(width: u16) -> widget::Rule<Renderer>
where
Renderer: iced_native::Renderer,
Renderer::Theme: widget::rule::StyleSheet,
{
widget::Rule::vertical(width)
}