Leverage DefaultStyle traits instead of Default

This commit is contained in:
Héctor Ramón Jiménez 2024-03-07 20:11:32 +01:00
parent 44f002f64a
commit 833538ee7f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
30 changed files with 393 additions and 437 deletions

View file

@ -47,7 +47,7 @@ where
position: Position,
) -> Self
where
container::Style<Theme>: Default,
Theme: container::DefaultStyle,
{
Tooltip {
content: content.into(),
@ -56,7 +56,7 @@ where
gap: 0.0,
padding: Self::DEFAULT_PADDING,
snap_within_viewport: true,
style: container::Style::default(),
style: Theme::default_style(),
}
}
@ -424,7 +424,7 @@ where
layout: Layout<'_>,
cursor_position: mouse::Cursor,
) {
let style = self.style.resolve(theme, container::Status::Idle);
let style = (self.style)(theme, container::Status::Idle);
container::draw_background(renderer, &style, layout.bounds());