pub struct MacButtonCell<'a> { /* private fields */ }Expand description
Authentic macOS AppKit Push Button / Tool Button (NSButtonCell equivalent).
Features authentic theme-driven background, border, selection states, typography metrics, and hover feedback.
§Example
use egui_macview::{MacButtonCell, MacTheme};
let theme = MacTheme::default();
if ui.add(MacButtonCell::new("Save Changes").theme(&theme)).clicked() {
// Handle save
}Implementations§
Source§impl<'a> MacButtonCell<'a>
impl<'a> MacButtonCell<'a>
Sourcepub fn theme(self, theme: &'a MacTheme) -> Self
pub fn theme(self, theme: &'a MacTheme) -> Self
Injects dynamic theme to eliminate hardcoded metrics and colors.
Sourcepub fn selected(self, selected: bool) -> Self
pub fn selected(self, selected: bool) -> Self
Sets whether the button is presented in an active/selected state.
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Overrides button width in points (defaults to content width + padding).
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Overrides button height in points (defaults to token regular button height).
Sourcepub fn corner_radius(self, r: f32) -> Self
pub fn corner_radius(self, r: f32) -> Self
Overrides corner radius in points (defaults to token corner radius).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for MacButtonCell<'a>
impl<'a> Freeze for MacButtonCell<'a>
impl<'a> RefUnwindSafe for MacButtonCell<'a>
impl<'a> Send for MacButtonCell<'a>
impl<'a> Sync for MacButtonCell<'a>
impl<'a> Unpin for MacButtonCell<'a>
impl<'a> UnsafeUnpin for MacButtonCell<'a>
impl<'a> UnwindSafe for MacButtonCell<'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