Ask for explicit Length in center_* methods

This commit is contained in:
Héctor Ramón Jiménez 2024-05-13 17:56:02 +02:00
parent b30d34f728
commit 05f69f495e
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F
13 changed files with 40 additions and 41 deletions

View file

@ -83,9 +83,10 @@ where
///
/// This is equivalent to:
/// ```rust,no_run
/// # use iced_widget::core::Length;
/// # use iced_widget::Container;
/// # fn container<A>(x: A) -> Container<'static, ()> { unreachable!() }
/// let centered = container("Centered!").center();
/// let centered = container("Centered!").center(Length::Fill);
/// ```
///
/// [`Container`]: crate::Container
@ -96,7 +97,7 @@ where
Theme: container::Catalog + 'a,
Renderer: core::Renderer,
{
container(content).fill().center()
container(content).center(Length::Fill)
}
/// Creates a new [`Column`] with the given children.