From a805177b250b2316c0a9b4de06a3be4556d6944a Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 22 Nov 2024 04:13:38 +0100 Subject: Make `pin` widget `Fill` parent by default --- widget/src/pin.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'widget/src/pin.rs') diff --git a/widget/src/pin.rs b/widget/src/pin.rs index 7d561894..1f167716 100644 --- a/widget/src/pin.rs +++ b/widget/src/pin.rs @@ -14,8 +14,6 @@ //! //! fn view(state: &State) -> Element<'_, Message> { //! pin("This text is displayed at coordinates (50, 50)!") -//! .width(Fill) -//! .height(Fill) //! .x(50) //! .y(50) //! .into() @@ -33,6 +31,8 @@ use crate::core::{ /// A widget that positions its contents at some fixed coordinates inside of its boundaries. /// +/// By default, a [`Pin`] widget will try to fill its parent. +/// /// # Example /// ```no_run /// # mod iced { pub mod widget { pub use iced_widget::*; } pub use iced_widget::core::Length::Fill; } @@ -47,8 +47,6 @@ use crate::core::{ /// /// fn view(state: &State) -> Element<'_, Message> { /// pin("This text is displayed at coordinates (50, 50)!") -/// .width(Fill) -/// .height(Fill) /// .x(50) /// .y(50) /// .into() @@ -75,8 +73,8 @@ where ) -> Self { Self { content: content.into(), - width: Length::Shrink, - height: Length::Shrink, + width: Length::Fill, + height: Length::Fill, position: Point::ORIGIN, } } -- cgit