Skip to main content

egui_charts/ui/top_toolbar/components/settings_menu/
actions.rs

1//! Actions emitted by settings UI components
2
3use crate::widget::settings::ChartSettingsState;
4
5/// Settings action (emitted by both SettingsMenu and SettingsDialog)
6#[derive(Clone, Debug)]
7#[non_exhaustive]
8pub enum SettingsAction {
9    /// No action taken
10    None,
11    /// Apply the given settings state to the chart
12    Apply(Box<ChartSettingsState>),
13    /// Play a local preview, activating browser audio in response to the user's click.
14    PreviewSound {
15        /// Host-provided sound name.
16        name: String,
17        /// Gain from zero (muted) to one.
18        volume: f32,
19    },
20    /// Cancel and discard pending settings changes
21    Cancel,
22    /// Save current settings as a named template
23    SaveTemplate(String),
24    /// Load a previously saved settings template by name
25    LoadTemplate(String),
26}