diff options
| author | 2024-03-16 16:12:07 +0100 | |
|---|---|---|
| committer | 2024-03-16 16:12:07 +0100 | |
| commit | bb71e8481ed59f991b9bd9dc55ea7e011ba0aac6 (patch) | |
| tree | 3e6a5550cd726af978fbc884f5f6af5bd68dfafd /src | |
| parent | 3f81c524ccad2dd3fc4e6144f68b133132b1421b (diff) | |
| download | iced-bb71e8481ed59f991b9bd9dc55ea7e011ba0aac6.tar.gz iced-bb71e8481ed59f991b9bd9dc55ea7e011ba0aac6.tar.bz2 iced-bb71e8481ed59f991b9bd9dc55ea7e011ba0aac6.zip  | |
Make `sandbox` helper take a `title` as well
Diffstat (limited to '')
| -rw-r--r-- | src/lib.rs | 2 | ||||
| -rw-r--r-- | src/program.rs | 7 | 
2 files changed, 5 insertions, 4 deletions
@@ -370,7 +370,7 @@ where      State: Default + 'static,      Message: std::fmt::Debug + Send + 'static,  { -    sandbox(update, view).title(title).run() +    sandbox(title, update, view).run()  }  #[doc(inline)] diff --git a/src/program.rs b/src/program.rs index 746f8f29..ab194a0d 100644 --- a/src/program.rs +++ b/src/program.rs @@ -15,8 +15,7 @@  //! use iced::Theme;  //!  //! pub fn main() -> iced::Result { -//!     iced::sandbox(update, view) -//!         .title("A counter") +//!     iced::sandbox("A counter", update, view)  //!         .theme(|_| Theme::Dark)  //!         .centered()  //!         .run() @@ -54,7 +53,7 @@ use std::borrow::Cow;  /// use iced::widget::{button, column, text, Column};  ///  /// pub fn main() -> iced::Result { -///     iced::sandbox(update, view).title("A counter").run() +///     iced::sandbox("A counter", update, view).run()  /// }  ///  /// #[derive(Debug, Clone)] @@ -76,6 +75,7 @@ use std::borrow::Cow;  /// }  /// ```  pub fn sandbox<State, Message>( +    title: impl Title<State>,      update: impl Fn(&mut State, Message),      view: impl for<'a> self::View<'a, State, Message>,  ) -> Program< @@ -138,6 +138,7 @@ where          },          settings: Settings::default(),      } +    .title(title)  }  /// Creates a [`Program`] that can leverage the [`Command`] API for  | 
