diff options
| author | 2024-11-22 04:13:38 +0100 | |
|---|---|---|
| committer | 2024-11-22 04:13:38 +0100 | |
| commit | a805177b250b2316c0a9b4de06a3be4556d6944a (patch) | |
| tree | 9a04331e34d54167cff40aab77d344f030b4d93e /widget/src | |
| parent | 5be1d545d0baa09b82fe380d9246f66474cce302 (diff) | |
| download | iced-a805177b250b2316c0a9b4de06a3be4556d6944a.tar.gz iced-a805177b250b2316c0a9b4de06a3be4556d6944a.tar.bz2 iced-a805177b250b2316c0a9b4de06a3be4556d6944a.zip  | |
Make `pin` widget `Fill` parent by default
Diffstat (limited to 'widget/src')
| -rw-r--r-- | widget/src/helpers.rs | 2 | ||||
| -rw-r--r-- | widget/src/pin.rs | 10 | 
2 files changed, 4 insertions, 8 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index a669b290..3d85ba70 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -267,8 +267,6 @@ where  ///  /// fn view(state: &State) -> Element<'_, Message> {  ///     pin("This text is displayed at coordinates (50, 50)!") -///         .width(Fill) -///         .height(Fill)  ///         .x(50)  ///         .y(50)  ///         .into() 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,          }      }  | 
