pub struct MenuProps<'a> {
pub title: &'a str,
pub message: &'a str,
pub exit_on_action: bool,
pub bg_color: u8,
pub fg_color: u8,
pub title_color: Option<u8>,
pub selected_color: Option<u8>,
pub msg_color: Option<u8>,
}
Expand description
Stores configuration data passed to a Menu
on creation.
Menus use 8-bit colors to ensure widespread terminal support. It should be noted that values from 0-15 will make colors vary based on individual terminal settings.
Configure a subset of properties using the defaults and struct update syntax:
let props = MenuProps {
title: "My Menu",
..MenuProps::default()
};
Fields§
§title: &'a str
Displays above the list of menu options. Pass an empty string for no title.
message: &'a str
Display below the list of menu options. Pass an empty string for no message.
exit_on_action: bool
If true, menu will exit immediately upon an option being selected.
bg_color: u8
The background color for the menu.
fg_color: u8
The foreground (text) color for the menu.
title_color: Option<u8>
Optional color for the title. If None, the foreground color will be used.
selected_color: Option<u8>
Optional color for the selected menu option. If None, the foreground color will be used.
msg_color: Option<u8>
Optional color for the footer message. If None, the foreground color will be used.