add builder functions (#731)

This commit is contained in:
maxomatic458 2024-01-29 15:31:07 +01:00 committed by GitHub
parent 34af84ebe0
commit 090af4d323
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,6 +237,24 @@ pub trait MenuBuilder: Menu + Sized {
self
}
/// Menu builder with new value for match style
/// This is the style of the part of the input text, the suggestions
/// are based on
#[must_use]
fn with_match_text_style(mut self, color: Style) -> Self {
self.settings_mut().color.match_style = color;
self
}
/// Menu builder with new value for selected match style
/// This is the style of the part of the input text, the suggestions
/// are based on
#[must_use]
fn with_selected_match_text_style(mut self, color: Style) -> Self {
self.settings_mut().color.selected_match_style = color;
self
}
/// Menu builder with new value for marker
#[must_use]
fn with_marker(mut self, marker: &str) -> Self {