message: Draw styling in `Widget::draw` for `Container`
diff: @@ -7,8 +7,8 @@ use crate::layout;
  use crate::overlay;
  use crate::renderer;
  use crate::{
  - Clipboard, Element, Hasher, Layout, Length, Padding, Point, Rectangle,
  - Widget,
  + Background, Clipboard, Color, Element, Hasher, Layout, Length, Padding,
  + Point, Rectangle, Widget,
  };
  use std::u32;
  @@ -27,7 +27,7 @@ pub struct Container<'a, Message, Renderer> {
  max_height: u32,
  horizontal_alignment: alignment::Horizontal,
  vertical_alignment: alignment::Vertical,
  - style: &'a dyn StyleSheet,
  + style_sheet: &'a dyn StyleSheet,
  content: Element<'a, Message, Renderer>,
  }
  @@ -48,7 +48,7 @@ where
  max_height: u32::MAX,
  horizontal_alignment: alignment::Horizontal::Left,
  vertical_alignment: alignment::Vertical::Top,
  - style: Default::default(),
  + style_sheet: Default::default(),
  content: content.into(),
  }
  }
  @@ -108,8 +108,8 @@ where
  }
  /// Sets the style of the [`Container`].
  - pub fn style(mut self, style: &'a dyn StyleSheet) -> Self {
  - self.style = style;
  + pub fn style(mut self, style_sheet: &'a dyn StyleSheet) -> Self {
  + self.style_sheet = style_sheet;
  self
  }
  }
  @@ -178,14 +178,22 @@ where
  fn draw(
  &self,
  renderer: &mut Renderer,
  - style: &renderer::Style,
  + renderer_style: &renderer::Style,
  layout: Layout<'_>,
  cursor_position: Point,
  viewport: &Rectangle,
  ) {
  + let style = self.style_sheet.style();
  +
  + draw_background(renderer, &style, layout.bounds());
  +
  self.content.draw(
  renderer,
  - style,
  + &renderer::Style {
  + text_color: style
  + .text_color
  + .unwrap_or(renderer_style.text_color),
  + },
  layout.children().next().unwrap(),
  cursor_position,
  viewport,
  @@ -213,6 +221,26 @@ where
  }
  }
  +pub fn draw_background<Renderer>(
  + renderer: &mut Renderer,
  + style: &Style,
  + bounds: Rectangle,
  +) where
  + Renderer: crate::Renderer,
  +{
  + if style.background.is_some() || style.border_width > 0.0 {
  + renderer.fill_rectangle(renderer::Quad {
  + bounds,
  + background: style
  + .background
  + .unwrap_or(Background::Color(Color::TRANSPARENT)),
  + border_radius: style.border_radius,
  + border_width: style.border_width,
  + border_color: style.border_color,
  + });
  + }
  +}
  +
  impl<'a, Message, Renderer> From<Container<'a, Message, Renderer>>
  for Element<'a, Message, Renderer>
  where
  