pub struct MacTokenField<'a> { /* private fields */ }Expand description
Authentic macOS AppKit token pill field (NSTokenField equivalent).
§Example
use egui_macview::{MacTheme, MacTokenField};
let theme = MacTheme::default();
let mut tokens = vec!["AppKit".to_string(), "AVKit".to_string()];
let mut input = String::new();
MacTokenField::new("keywords", &mut tokens, &mut input)
.theme(&theme)
.max_chars(120)
.show(ui);Implementations§
Source§impl<'a> MacTokenField<'a>
impl<'a> MacTokenField<'a>
Sourcepub fn new(
id_src: impl Hash + Debug,
tokens: &'a mut Vec<String>,
input_buffer: &'a mut String,
) -> Self
pub fn new( id_src: impl Hash + Debug, tokens: &'a mut Vec<String>, input_buffer: &'a mut String, ) -> Self
Creates a new MacTokenField bound to tokens and input_buffer.
Sourcepub fn placeholder(self, placeholder: &'a str) -> Self
pub fn placeholder(self, placeholder: &'a str) -> Self
Sets placeholder text shown when no tokens or input text are present.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for MacTokenField<'a>
impl<'a> Forget for MacTokenField<'a>
impl<'a> Freeze for MacTokenField<'a>
impl<'a> RefUnwindSafe for MacTokenField<'a>
impl<'a> Send for MacTokenField<'a>
impl<'a> Sync for MacTokenField<'a>
impl<'a> Unpin for MacTokenField<'a>
impl<'a> UnsafeUnpin for MacTokenField<'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