Enum WindowWidth
pub enum WindowWidth {
Narrow,
Normal,
Wide,
Fraction(u16),
}Expand description
Persisted width of a [crate::WindowGroup], as a fraction of the
strip’s usable width — a stored pixel count would mean a different
screen share on every monitor.
Variants§
Narrow
Normal
Wide
Fraction(u16)
An arbitrary fraction of the strip’s usable width, in per-mille. What a manual resize persists.
Implementations§
§impl WindowWidth
impl WindowWidth
pub fn permille(&self) -> u16
pub fn permille(&self) -> u16
The fraction this width represents, in per-mille of the strip’s usable width.
pub fn fraction(&self) -> f64
pub fn fraction(&self) -> f64
Self::permille as a fraction in [0.15, 1.0].
pub fn resolve(&self, strip_usable_px: f64) -> f64
pub fn resolve(&self, strip_usable_px: f64) -> f64
Resolve to logical pixels against a strip of strip_usable_px,
clamped into [min_group_px, max_group_px] so a fraction can
neither collapse a group below usability nor push it past the
output’s right edge.
pub fn from_px(px: f64, strip_usable_px: f64) -> WindowWidth
pub fn from_px(px: f64, strip_usable_px: f64) -> WindowWidth
Always a WindowWidth::Fraction — records the proportion the
user landed on rather than a coincident tier, so a later tier
retune doesn’t silently move their window.
Trait Implementations§
§impl Clone for WindowWidth
impl Clone for WindowWidth
§fn clone(&self) -> WindowWidth
fn clone(&self) -> WindowWidth
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 WindowWidth
impl Debug for WindowWidth
§impl<'de> Deserialize<'de> for WindowWidth
impl<'de> Deserialize<'de> for WindowWidth
§fn deserialize<D>(d: D) -> Result<WindowWidth, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<WindowWidth, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Clamps a persisted fraction into the supported range.
§impl PartialEq for WindowWidth
impl PartialEq for WindowWidth
§impl Serialize for WindowWidth
impl Serialize for WindowWidth
§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 WindowWidth
impl Eq for WindowWidth
impl StructuralPartialEq for WindowWidth
Auto Trait Implementations§
impl Freeze for WindowWidth
impl RefUnwindSafe for WindowWidth
impl Send for WindowWidth
impl Sync for WindowWidth
impl Unpin for WindowWidth
impl UnsafeUnpin for WindowWidth
impl UnwindSafe for WindowWidth
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> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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