egui_charts/ui_kit/command_palette/mod.rs
1//! Command Palette Component
2//!
3//! A searchable command palette (Ctrl+K / Cmd+K style) for quick command access.
4//!
5//! # Usage
6//!
7//! ```
8//! use egui::{Key, KeyboardShortcut, Modifiers};
9//! use egui_charts::ui_kit::command_palette::{Command, CommandPaletteHandler};
10//!
11//! // Create a handler with commands
12//! let mut handler = CommandPaletteHandler::new(vec![
13//! Command::new("new_chart", "New Chart")
14//! .shortcut(KeyboardShortcut::new(Modifiers::COMMAND, Key::N))
15//! .category("File"),
16//! Command::new("settings", "Open Settings")
17//! .category("Preferences"),
18//! Command::new("add_indicator", "Add Indicator")
19//! .category("Trading"),
20//! ]);
21//!
22//! // In your update loop
23//! # egui::__run_test_ctx(|ctx| {
24//! if let Some(command_id) = handler.update(ctx) {
25//! match command_id.as_str() {
26//! "new_chart" => { /* create a new chart */ }
27//! "settings" => { /* open settings */ }
28//! "add_indicator" => { /* show the indicator dialog */ }
29//! _ => {}
30//! }
31//! }
32//! # });
33//! ```
34
35mod command;
36mod fuzzy;
37mod palette;
38
39pub use command::Command;
40pub use fuzzy::{FuzzyMatch, fuzzy_match, fuzzy_search};
41pub use palette::{CommandPalette, CommandPaletteHandler};