pub struct SetupWizard<'a, Msg> { /* private fields */ }Expand description
The first-run wizard: the appearance step the framework draws and drives, then a step for each
one the application adds, on the Wizard every other flow uses.
The first step asks for the language, the theme and the icons as
Appearance rows, each with its “In every Quvyta application” box, and shows the same icons
in all three glyph modes so the user chooses by eye. Without a Nerd Font on the machine it
offers to install the symbols, shows how far the install is and, once it is done, what to look
at (nerd_font::after_install_text). Under the rows, “Start with the defaults” writes what is
filled in and ends the wizard.
Build it in view from the Setup the application holds; see Setup for the whole of it.
Implementations§
Source§impl<'a, Msg: Clone + Send + 'static> SetupWizard<'a, Msg>
impl<'a, Msg: Clone + Send + 'static> SetupWizard<'a, Msg>
Sourcepub fn step(
self,
title: impl Into<String>,
page: impl FnOnce(&mut View<'_, Msg>) + 'a,
) -> Self
pub fn step( self, title: impl Into<String>, page: impl FnOnce(&mut View<'_, Msg>) + 'a, ) -> Self
Adds a step of the application’s own, named title, whose page is built by page and
whose messages are the application’s. Steps come in the order they are added, after the
appearance step.
Sourcepub fn on_cancel(self, message: Msg) -> Self
pub fn on_cancel(self, message: Msg) -> Self
Adds a Cancel button, and makes Esc inside the wizard send message too. Closing the
wizard writes nothing at all, so the application usually quits on it and the wizard comes
again next start.
Sourcepub fn page_height(self, rows: u16) -> Self
pub fn page_height(self, rows: u16) -> Self
Gives every step exactly rows rows, so the buttons stay put between steps.
Auto Trait Implementations§
impl<'a, Msg> !RefUnwindSafe for SetupWizard<'a, Msg>
impl<'a, Msg> !Send for SetupWizard<'a, Msg>
impl<'a, Msg> !Sync for SetupWizard<'a, Msg>
impl<'a, Msg> !UnwindSafe for SetupWizard<'a, Msg>
impl<'a, Msg> Freeze for SetupWizard<'a, Msg>
impl<'a, Msg> Unpin for SetupWizard<'a, Msg>
impl<'a, Msg> UnsafeUnpin for SetupWizard<'a, Msg>where
&'a Setup<Msg>: UnsafeUnpin,
Vec<(String, Box<dyn FnOnce(&mut View<'_, Msg>) + 'a>)>: UnsafeUnpin,
Option<Msg>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more