diff options
| author | 2024-06-20 00:40:37 -0500 | |
|---|---|---|
| committer | 2024-06-20 00:40:37 -0500 | |
| commit | 3334cf670b09ee2ef0d06c9005677e024050f121 (patch) | |
| tree | 5a401ac6a8aedb707061598e2da7772949ca1fd2 | |
| parent | 714d4503154a6224c26f2eed6e399c73d57b4bf8 (diff) | |
| download | iced-3334cf670b09ee2ef0d06c9005677e024050f121.tar.gz iced-3334cf670b09ee2ef0d06c9005677e024050f121.tar.bz2 iced-3334cf670b09ee2ef0d06c9005677e024050f121.zip  | |
feat: Add methods for window settings in Application
This commit adds new methods to the `Application` struct for setting various window settings such as resizable, decorations, position, and level. These methods allow for more customization and control over the appearance and behavior of the application window.
| -rw-r--r-- | src/application.rs | 44 | 
1 files changed, 44 insertions, 0 deletions
diff --git a/src/application.rs b/src/application.rs index edca6e79..7b292e23 100644 --- a/src/application.rs +++ b/src/application.rs @@ -256,6 +256,50 @@ impl<P: Program> Application<P> {          }      } +    /// Sets the [`window::Settings::resizable`] of the [`Application`]. +    pub fn resizable(self, resizable: bool) -> Self { +        Self { +            window: window::Settings { +                resizable, +                ..self.window +            }, +            ..self +        } +    } + +    /// Sets the [`window::Settings::decorations`] of the [`Application`]. +    pub fn decorations(self, decorations: bool) -> Self { +        Self { +            window: window::Settings { +                decorations, +                ..self.window +            }, +            ..self +        } +    } + +    /// Sets the [`window::Settings::position`] of the [`Application`]. +    pub fn position(self, position: window::Position) -> Self { +        Self { +            window: window::Settings { +                position, +                ..self.window +            }, +            ..self +        } +    } +     +    /// Sets the [`window::Settings::level`] of the [`Application`]. +    pub fn level(self, level: window::Level) -> Self { +        Self { +            window: window::Settings { +                level, +                ..self.window +            }, +            ..self +        } +    } +      /// Sets the [`Title`] of the [`Application`].      pub(crate) fn title(          self,  | 
