Struct SelectorFinish
pub struct SelectorFinish {
pub strip: StripMaterial,
pub rim_span: f32,
pub rim_alpha: f32,
pub hover_alpha: f32,
}Expand description
How selectors are finished. Selection itself (which state lifts how far) is not the theme’s to change: the active item is always one surface step of its ground; this only says what the strip is made of, how the light catches an active item and how much of the lift a hover shows.
Fields§
§strip: StripMaterial§rim_span: f32How far down an active item its lit rim reaches before it is gone, as a share of the item’s height. A rim lit all the way round is a halo, not light.
rim_alpha: f32Opacity of the lit rim where it is brightest, at the item’s top.
0 paints no rim.
hover_alpha: f32Opacity of the hover film: the active lift laid over the strip at this strength, so the strip still shows through a hovered item.
Implementations§
§impl SelectorFinish
impl SelectorFinish
pub const STOCK: SelectorFinish
pub const STOCK: SelectorFinish
The stock finish: a frosted strip, a rim that fades over the top
half, and a hover strong enough to clear the selection step on an
opaque ground (crate::chrome::SELECTION_MIN_STEP).
pub const OPAQUE: SelectorFinish
pub const OPAQUE: SelectorFinish
High contrast: a solid strip and no rim. Its hover is composited onto the ground it stands on, so it is opaque too.
pub const RIM_SPAN_ADMITTED: RangeInclusive<f32>
pub const RIM_SPAN_ADMITTED: RangeInclusive<f32>
Rim span band a document may state.
pub const RIM_ALPHA_ADMITTED: RangeInclusive<f32>
pub const RIM_ALPHA_ADMITTED: RangeInclusive<f32>
Rim opacity band a document may state: past it the rim reads as a second edge.
pub const HOVER_ALPHA_ADMITTED: RangeInclusive<f32>
pub const HOVER_ALPHA_ADMITTED: RangeInclusive<f32>
Hover opacity band a document may state: below it a hovered item no longer clears the selection step on the lightest ground.
pub fn translucent(&self) -> bool
pub fn translucent(&self) -> bool
Whether the hover film and the strip may let what is behind them through.
pub fn rim(&self) -> Option<AlphaColor<Srgb>>
pub fn rim(&self) -> Option<AlphaColor<Srgb>>
The lit rim’s colour at its brightest, or None without a rim. Light,
whichever way the palette lifts: it is the light landing on the
item, not a shade of the item.
pub fn frosted_extremes(
colors: &Colors,
ground: AlphaColor<Srgb>,
opacity: f32,
) -> [AlphaColor<Srgb>; 2]
pub fn frosted_extremes( colors: &Colors, ground: AlphaColor<Srgb>, opacity: f32, ) -> [AlphaColor<Srgb>; 2]
What a frosted strip of ground tinted at opacity can look like at
its darkest and its lightest: the tint over each end of the band the
desktop picture is held in first
(crate::tokens::finish::material_band),
as every blurred material is. Ink on the strip holds against both,
whatever the desktop is.
pub fn effective(self, opaque: bool) -> SelectorFinish
pub fn effective(self, opaque: bool) -> SelectorFinish
The finish actually painted: where nothing may be translucent (forced colours, reduced transparency) a solid strip with no rim, whatever the theme says; the hover keeps its strength, composited.
Trait Implementations§
§impl Clone for SelectorFinish
impl Clone for SelectorFinish
§fn clone(&self) -> SelectorFinish
fn clone(&self) -> SelectorFinish
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for SelectorFinish
impl Debug for SelectorFinish
§impl<'de> Deserialize<'de> for SelectorFinish
impl<'de> Deserialize<'de> for SelectorFinish
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SelectorFinish, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SelectorFinish, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for SelectorFinish
impl PartialEq for SelectorFinish
§impl Serialize for SelectorFinish
impl Serialize for SelectorFinish
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for SelectorFinish
impl StructuralPartialEq for SelectorFinish
Auto Trait Implementations§
impl Freeze for SelectorFinish
impl RefUnwindSafe for SelectorFinish
impl Send for SelectorFinish
impl Sync for SelectorFinish
impl Unpin for SelectorFinish
impl UnsafeUnpin for SelectorFinish
impl UnwindSafe for SelectorFinish
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more