Expand description
Command Palette Component
A searchable command palette (Ctrl+K / Cmd+K style) for quick command access.
§Usage
use egui::{Key, KeyboardShortcut, Modifiers};
use egui_charts::ui_kit::command_palette::{Command, CommandPaletteHandler};
// Create a handler with commands
let mut handler = CommandPaletteHandler::new(vec![
Command::new("new_chart", "New Chart")
.shortcut(KeyboardShortcut::new(Modifiers::COMMAND, Key::N))
.category("File"),
Command::new("settings", "Open Settings")
.category("Preferences"),
Command::new("add_indicator", "Add Indicator")
.category("Trading"),
]);
// In your update loop
if let Some(command_id) = handler.update(ctx) {
match command_id.as_str() {
"new_chart" => { /* create a new chart */ }
"settings" => { /* open settings */ }
"add_indicator" => { /* show the indicator dialog */ }
_ => {}
}
}Structs§
- Command
- A command that can be executed from the command palette
- Command
Palette - Command palette widget for quick command access
- Command
Palette Handler - Handler for managing command palette state
- Fuzzy
Match - Result of a fuzzy match
Functions§
- fuzzy_
match - Perform fuzzy matching of a query against a target string
- fuzzy_
search - Search through a list of items and return matches sorted by score