Struct egui_autocomplete::AutoCompleteTextEdit
source · pub struct AutoCompleteTextEdit<'a, T> { /* private fields */ }
Expand description
An extension to the egui::TextEdit
that allows for a dropdown box with autocomplete to popup while typing.
Implementations§
source§impl<'a, T, S> AutoCompleteTextEdit<'a, T>
impl<'a, T, S> AutoCompleteTextEdit<'a, T>
sourcepub fn new(text_field: &'a mut String, search: T) -> Self
pub fn new(text_field: &'a mut String, search: T) -> Self
Creates a new AutoCompleteTextEdit
.
text_field
- Contents of the text edit passed into egui::TextEdit
search
- Data use as the search term
source§impl<'a, T, S> AutoCompleteTextEdit<'a, T>
impl<'a, T, S> AutoCompleteTextEdit<'a, T>
sourcepub fn max_suggestions(self, max_suggestions: usize) -> Self
pub fn max_suggestions(self, max_suggestions: usize) -> Self
This determines the number of options appear in the dropdown menu
sourcepub fn highlight_matches(self, highlight: bool) -> Self
pub fn highlight_matches(self, highlight: bool) -> Self
If set to true, characters will be highlighted in the dropdown to show the match
sourcepub fn set_text_edit_properties(
self,
set_properties: impl FnOnce(TextEdit<'_>) -> TextEdit<'_> + 'static,
) -> Self
pub fn set_text_edit_properties( self, set_properties: impl FnOnce(TextEdit<'_>) -> TextEdit<'_> + 'static, ) -> Self
Can be used to set the properties of the internal egui::TextEdit
§Example
AutoCompleteTextEdit::new(&mut search_field, &inputs)
.set_text_edit_properties(|text_edit: egui::TextEdit<'_>| {
text_edit
.hint_text("Hint Text")
.text_color(egui::Color32::RED)
});
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for AutoCompleteTextEdit<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for AutoCompleteTextEdit<'a, T>
impl<'a, T> !Send for AutoCompleteTextEdit<'a, T>
impl<'a, T> !Sync for AutoCompleteTextEdit<'a, T>
impl<'a, T> Unpin for AutoCompleteTextEdit<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for AutoCompleteTextEdit<'a, T>
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