pub struct MacLabel<'a> { /* private fields */ }Expand description
Authentic macOS AppKit Non-Editable Label (NSTextField.labelWithString:).
§Example
use egui_macview::{
MacAppearance, MacControlSize, MacFontWeight, MacLabel, MacLabelColor, MacTheme,
};
let theme = MacTheme::new(MacAppearance::Aqua);
MacLabel::new("Output Resolution:")
.control_size(MacControlSize::Regular)
.weight(MacFontWeight::Semibold)
.color(MacLabelColor::Primary)
.theme(&theme)
.show(ui);Implementations§
Source§impl<'a> MacLabel<'a>
impl<'a> MacLabel<'a>
Sourcepub fn new(text: impl Into<WidgetText>) -> Self
pub fn new(text: impl Into<WidgetText>) -> Self
Creates a new AppKit non-editable label with text.
Sourcepub fn control_size(self, size: MacControlSize) -> Self
pub fn control_size(self, size: MacControlSize) -> Self
Sets the AppKit control size (Regular 13pt, Small 11pt, Mini 9pt).
Sourcepub fn weight(self, weight: MacFontWeight) -> Self
pub fn weight(self, weight: MacFontWeight) -> Self
Sets the font weight (Regular, Medium, Semibold, Bold).
Sourcepub fn color(self, color: MacLabelColor) -> Self
pub fn color(self, color: MacLabelColor) -> Self
Sets the semantic label color (Primary, Secondary, Tertiary).
Sourcepub fn alignment(self, alignment: Align) -> Self
pub fn alignment(self, alignment: Align) -> Self
Sets horizontal text alignment (Align::Min, Align::Center, Align::Max).
Sourcepub fn fixed_rect(self, rect: Rect) -> Self
pub fn fixed_rect(self, rect: Rect) -> Self
Pins the label to an exact NIB rectangle.
Sourcepub fn resolved_color(&self, theme: &MacTheme) -> Color32
pub fn resolved_color(&self, theme: &MacTheme) -> Color32
Resolves the semantic Color32 from theme on the default window background.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for MacLabel<'a>
impl<'a> Freeze for MacLabel<'a>
impl<'a> Move for MacLabel<'a>
impl<'a> RefUnwindSafe for MacLabel<'a>
impl<'a> Send for MacLabel<'a>
impl<'a> Sync for MacLabel<'a>
impl<'a> Unpin for MacLabel<'a>
impl<'a> UnsafeUnpin for MacLabel<'a>
impl<'a> UnwindSafe for MacLabel<'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