Skip to main content

SystemUiOverlayStyle

Struct SystemUiOverlayStyle 

Source
pub struct SystemUiOverlayStyle {
    pub status_bar_color: Option<Color>,
    pub status_bar_icons: Option<Brightness>,
    pub navigation_bar_color: Option<Color>,
    pub navigation_bar_icons: Option<Brightness>,
}
Expand description

What a part of the screen asks of the system bars over it — the reference’s SystemUiOverlayStyle.

Every field is optional: a region states what it cares about, and the rest comes from the region beneath it and finally from the theme (SystemUiOverlayStyle::resolve).

The icons are named by their own brightness: Brightness::Dark is dark icons, for a light bar. That is the question a reader of the screen answers — can I read the clock — and the platform’s own name for it, a “light status bar”, is the opposite word.

Fields§

§status_bar_color: Option<Color>

The status bar’s background.

§status_bar_icons: Option<Brightness>

The status bar’s icons: the clock, the battery, the signal.

§navigation_bar_color: Option<Color>

The navigation bar’s background.

§navigation_bar_icons: Option<Brightness>

The navigation bar’s icons, or its gesture handle.

Implementations§

Source§

impl SystemUiOverlayStyle

Source

pub const NONE: Self

States nothing: every field is left to what lies beneath.

Source

pub fn for_background(color: Color) -> Self

Both bars in color, with icons that can be read on it.

Source

pub fn status_bar_color(self, color: Color) -> Self

The status bar’s background. Its icons, unless stated too, are chosen to be read on it — not taken from the theme, which answers for a different colour.

Source

pub fn status_bar_icons(self, icons: Brightness) -> Self

The status bar’s icons: Brightness::Dark for dark icons.

Source

pub fn navigation_bar_color(self, color: Color) -> Self

The navigation bar’s background, with the same rule for its icons.

Source

pub fn navigation_bar_icons(self, icons: Brightness) -> Self

The navigation bar’s icons: Brightness::Dark for dark icons.

Source

pub fn over(self, under: Self) -> Self

This, with whatever it does not state filled in from under.

Source

pub fn resolve(self, theme: &Theme) -> SystemBars

Every question answered: what is stated, and the theme for the rest.

A bar whose colour is stated but not its icons gets icons read on that colour, so a region that only paints a bar black still gets a readable clock.

Trait Implementations§

Source§

impl Clone for SystemUiOverlayStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SystemUiOverlayStyle

Source§

impl Debug for SystemUiOverlayStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SystemUiOverlayStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SystemUiOverlayStyle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SystemUiOverlayStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.