pub struct SplashScreen { /* private fields */ }Expand description
The opening screen that covers the window while the app loads: a logo or icon, the app’s name, a status message and its progress.
It takes no input and has nothing to focus, so the page behind it stays out
of reach until the app sets visible to false and the screen fades out. It
is on screen from the very first frame, with no fade in. Without
Self::progress it shows a Spinner.
Status and progress are plain values, so build it where they are read, such
as in a Component body or a view_fn.
use ravenrs_reactive::State;
use ravenrs_widgets::{IconName, SplashScreen, View, view_fn};
let loading = State::new(true);
let progress = State::new(0.25);
let splash = view_fn(move || {
SplashScreen::new(loading.binding(), "Raven Finance")
.icon(IconName::Wallet)
.status("Opening the database")
.progress(progress.get())
});Implementations§
Source§impl SplashScreen
impl SplashScreen
Sourcepub fn new(visible: Binding<bool>, name: impl Into<String>) -> SplashScreen
pub fn new(visible: Binding<bool>, name: impl Into<String>) -> SplashScreen
A splash screen for the app called name, shown while visible is true.
Sourcepub fn logo(self, logo: impl View + 'static) -> SplashScreen
pub fn logo(self, logo: impl View + 'static) -> SplashScreen
Shows the app’s own artwork above the name, such as an Image.
It replaces Self::icon.
Sourcepub fn icon(self, icon: IconName) -> SplashScreen
pub fn icon(self, icon: IconName) -> SplashScreen
Shows an icon in the accent color above the name.
Sourcepub fn status(self, status: impl Into<String>) -> SplashScreen
pub fn status(self, status: impl Into<String>) -> SplashScreen
Sets the one-line message under the name. Screen readers announce each new one.
Sourcepub fn progress(self, value: f32) -> SplashScreen
pub fn progress(self, value: f32) -> SplashScreen
Replaces the spinner with a progress bar at value, clamped to 0.0–1.0.
Sourcepub fn reveal_after(self, seconds: f64) -> SplashScreen
pub fn reveal_after(self, seconds: f64) -> SplashScreen
Holds the name back this many seconds, and what is under it a little longer,
for an animated Self::logo to play alone. Their places are kept, so nothing
moves when they appear, and screen readers have them from the start. Where
motion is reduced they show at once.
Trait Implementations§
Source§impl Debug for SplashScreen
impl Debug for SplashScreen
Auto Trait Implementations§
impl !RefUnwindSafe for SplashScreen
impl !Send for SplashScreen
impl !Sync for SplashScreen
impl !UnwindSafe for SplashScreen
impl Freeze for SplashScreen
impl Unpin for SplashScreen
impl UnsafeUnpin for SplashScreen
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
None keeps the content size.