pub struct MacInputCell<'a> { /* private fields */ }Expand description
Authentic macOS compact text entry cell (AppKit NSTextFieldCell style).
Features transactional input buffering, Escape rollback, Return confirmation, deterministic Tab-chain cyclic focus navigation, and theme-driven focus ring styling.
§Example
use egui_macview::{MacInputCell, MacTheme};
let theme = MacTheme::default();
let mut text = String::from("Hello macOS");
MacInputCell::new("input_demo", &mut text)
.theme(&theme)
.placeholder("Type here...")
.show(ui);Implementations§
Source§impl<'a> MacInputCell<'a>
impl<'a> MacInputCell<'a>
Sourcepub fn new(id_source: impl Hash + Debug, value: &'a mut String) -> Self
pub fn new(id_source: impl Hash + Debug, value: &'a mut String) -> Self
Creates a new MacInputCell bound to value and identified by id_source.
Sourcepub fn with_id(id: Id, value: &'a mut String) -> Self
pub fn with_id(id: Id, value: &'a mut String) -> Self
Creates a cell directly with an existing egui::Id without double-hashing.
Sourcepub fn numeric(self, range: RangeInclusive<f64>, step: f64) -> Self
pub fn numeric(self, range: RangeInclusive<f64>, step: f64) -> Self
Configures numeric arrow-key stepping (ArrowUp/ArrowDown by ±step,
Shift by ±10 * step, Cmd/Ctrl by ±100 * step, clamped to range).
Sourcepub fn control_size(self, control_size: MacControlSize) -> Self
pub fn control_size(self, control_size: MacControlSize) -> Self
Sets the AppKit control size preset (Regular, Small, Mini, Large, CompactInfobox).
Sourcepub fn enabled(self, enabled: bool) -> Self
pub fn enabled(self, enabled: bool) -> Self
Enables or disables user interaction on the input cell.
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 height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Overrides cell height in points (defaults to token text field height).
Sourcepub fn placeholder(self, text: &'a str) -> Self
pub fn placeholder(self, text: &'a str) -> Self
Sets placeholder text displayed when the text field is empty and unfocused.
Sourcepub fn next_focus(self, id: Id) -> Self
pub fn next_focus(self, id: Id) -> Self
Sets the deterministic Tab navigation target.
Sourcepub fn prev_focus(self, id: Id) -> Self
pub fn prev_focus(self, id: Id) -> Self
Sets the deterministic Shift+Tab navigation target.
Auto Trait Implementations§
impl<'a> !UnwindSafe for MacInputCell<'a>
impl<'a> Forget for MacInputCell<'a>
impl<'a> Freeze for MacInputCell<'a>
impl<'a> RefUnwindSafe for MacInputCell<'a>
impl<'a> Send for MacInputCell<'a>
impl<'a> Sync for MacInputCell<'a>
impl<'a> Unpin for MacInputCell<'a>
impl<'a> UnsafeUnpin for MacInputCell<'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
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> ⓘ
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