pub struct ListMenu { /* private fields */ }
Expand description
Struct to store the menu style Context menu definition
Implementations§
source§impl ListMenu
impl ListMenu
sourcepub fn with_text_style(self, text_style: Style) -> Self
pub fn with_text_style(self, text_style: Style) -> Self
Menu builder with new value for text style
sourcepub fn with_selected_text_style(self, selected_text_style: Style) -> Self
pub fn with_selected_text_style(self, selected_text_style: Style) -> Self
Menu builder with new value for text style
sourcepub fn with_description_text_style(self, description_text_style: Style) -> Self
pub fn with_description_text_style(self, description_text_style: Style) -> Self
Menu builder with new value for description style
sourcepub fn with_page_size(self, page_size: usize) -> Self
pub fn with_page_size(self, page_size: usize) -> Self
Menu builder with new page size
sourcepub fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self
pub fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self
Menu builder with new only buffer difference
source§impl ListMenu
impl ListMenu
sourcepub fn with_marker(self, marker: String) -> Self
pub fn with_marker(self, marker: String) -> Self
Menu builder with menu marker
sourcepub fn with_max_entry_lines(self, max_lines: u16) -> Self
pub fn with_max_entry_lines(self, max_lines: u16) -> Self
Menu builder with max entry lines
Trait Implementations§
source§impl Menu for ListMenu
impl Menu for ListMenu
source§fn can_quick_complete(&self) -> bool
fn can_quick_complete(&self) -> bool
There is no use for quick complete for the menu
source§fn can_partially_complete(
&mut self,
_values_updated: bool,
_editor: &mut Editor,
_completer: &mut dyn Completer
) -> bool
fn can_partially_complete(
&mut self,
_values_updated: bool,
_editor: &mut Editor,
_completer: &mut dyn Completer
) -> bool
The menu should not try to auto complete to avoid comparing all registered values
Selects what type of event happened with the menu
source§fn update_values(&mut self, editor: &mut Editor, completer: &mut dyn Completer)
fn update_values(&mut self, editor: &mut Editor, completer: &mut dyn Completer)
Collecting the value from the completer to be shown in the menu
source§fn get_values(&self) -> &[Suggestion]
fn get_values(&self) -> &[Suggestion]
Gets values from cached values that will be displayed in the menu
source§fn replace_in_buffer(&self, editor: &mut Editor)
fn replace_in_buffer(&self, editor: &mut Editor)
The buffer gets cleared with the actual value
Calculates the real required lines for the menu considering how many lines wrap the terminal and if an entry is larger than the remaining lines
Creates the menu representation as a string which will be painted by the painter