pub enum Vibrancy {
Auto,
On,
Off,
}Expand description
Whether the window composites translucent — AppKit’s vibrancy.
Three-valued rather than a bool because the honest answer depends on the appearance, and the appearance moves under the app: the OS switches at sunset. A bool would have to be rewritten by whoever noticed, and nothing outside this crate is told when a palette is installed.
Variants§
Auto
Frost where the palette is built for it, which is dark alone.
Light’s glass tokens sit near 85% opacity — see Theme::glass_overlay,
Theme::card_glass_bg and Theme::input_glass_bg, each tuned there
because a translucent white tint left text ghosting over whatever sat
behind it. Light pays for the blur and shows almost none of it, so it is
not asked for unless an app says so.
On
Frost in both appearances. What an app asks for when it has tuned its own light palette to carry one.
Off
Opaque in both. What a Reduce-transparency switch sets.
Implementations§
Source§impl Vibrancy
impl Vibrancy
Sourcepub fn on(self, appearance: Appearance) -> bool
pub fn on(self, appearance: Appearance) -> bool
Whether to composite translucent for appearance.
The platform gate rides on Vibrancy::Auto rather than on the caller:
off macOS there is no compositor-blur guarantee, and a window that is
merely transparent shows raw desktop through the sidebar. An app that
knows its compositor says Vibrancy::On and gets it.
Trait Implementations§
impl Copy for Vibrancy
impl Eq for Vibrancy
impl StructuralPartialEq for Vibrancy
Auto Trait Implementations§
impl Freeze for Vibrancy
impl RefUnwindSafe for Vibrancy
impl Send for Vibrancy
impl Sync for Vibrancy
impl Unpin for Vibrancy
impl UnsafeUnpin for Vibrancy
impl UnwindSafe for Vibrancy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().