pub struct MacLevelIndicator<'a> { /* private fields */ }Expand description
Authentic macOS AppKit signal and audio level meter (NSLevelIndicator equivalent).
§Example
use egui_macview::{MacLevelIndicator, MacLevelIndicatorStyle, MacTheme};
let theme = MacTheme::default();
MacLevelIndicator::new(-12.0, -60.0..=0.0)
.theme(&theme)
.warning_value(-18.0)
.critical_value(-6.0)
.peak_hold(-3.0)
.style(MacLevelIndicatorStyle::Discrete)
.show(ui);Implementations§
Source§impl<'a> MacLevelIndicator<'a>
impl<'a> MacLevelIndicator<'a>
Sourcepub fn new(value: f32, range: RangeInclusive<f32>) -> Self
pub fn new(value: f32, range: RangeInclusive<f32>) -> Self
Creates a new level indicator for value within range.
Sourcepub fn warning_value(self, warning: f32) -> Self
pub fn warning_value(self, warning: f32) -> Self
Sets warning threshold where meter switches from green to yellow/amber.
Sourcepub fn critical_value(self, critical: f32) -> Self
pub fn critical_value(self, critical: f32) -> Self
Sets critical threshold where meter switches from yellow/amber to red.
Sourcepub fn style(self, style: MacLevelIndicatorStyle) -> Self
pub fn style(self, style: MacLevelIndicatorStyle) -> Self
Sets meter style (Continuous or Discrete).
Sourcepub fn orientation(self, orientation: MacLevelOrientation) -> Self
pub fn orientation(self, orientation: MacLevelOrientation) -> Self
Sets meter orientation (Horizontal or Vertical).
Sourcepub fn segmented_threshold_colors(self, enabled: bool) -> Self
pub fn segmented_threshold_colors(self, enabled: bool) -> Self
Enables per-segment VU meter threshold coloring instead of uniform AppKit discrete capacity color.
Sourcepub fn tick_marks(self, count: usize) -> Self
pub fn tick_marks(self, count: usize) -> Self
Sets the number of graduation tick marks rendered along the meter axis.
Sourcepub fn color_for_value(&self, theme: &MacTheme, sample_value: f32) -> Color32
pub fn color_for_value(&self, theme: &MacTheme, sample_value: f32) -> Color32
Evaluates the semantic AppKit meter color for a given sample level sample_value.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for MacLevelIndicator<'a>
impl<'a> Freeze for MacLevelIndicator<'a>
impl<'a> RefUnwindSafe for MacLevelIndicator<'a>
impl<'a> Send for MacLevelIndicator<'a>
impl<'a> Sync for MacLevelIndicator<'a>
impl<'a> Unpin for MacLevelIndicator<'a>
impl<'a> UnsafeUnpin for MacLevelIndicator<'a>
impl<'a> UnwindSafe for MacLevelIndicator<'a>
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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