pub struct SettingsDialog {
pub is_open: bool,
pub templates: TemplateStore<ChartSettingsState>,
pub execution_sounds: Vec<String>,
/* private fields */
}Expand description
Modal settings dialog with tabbed interface.
Edits chart display settings, event category visibility and the host trading and alert-overlay preferences.
Fields§
§is_open: boolWhether the dialog is currently open
templates: TemplateStore<ChartSettingsState>Host-readable chart templates and their optional storage connection.
execution_sounds: Vec<String>The local sounds the host can play, by name, offered on the Trading and Alerts tabs. The host
plays the chosen one; see
Trading::take_execution_sound.
Without any, the tab offers no choice.
Implementations§
Source§impl SettingsDialog
impl SettingsDialog
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a SettingsDialog with default settings.
Sourcepub fn set_control_visible(&mut self, control: Control, visible: bool)
pub fn set_control_visible(&mut self, control: Control, visible: bool)
Shows or hides control: Templates (the template button and menu; Reset to defaults
then takes the button’s place). The dialog ignores the other controls.
Sourcepub fn set_feed_capabilities(
&mut self,
capabilities: Option<&FeedCapabilities>,
instrument: Option<&Instrument>,
)
pub fn set_feed_capabilities( &mut self, capabilities: Option<&FeedCapabilities>, instrument: Option<&Instrument>, )
Restrict Order flow controls to services explicitly declared for the chart’s instrument.
Pass Chart::feed_capabilities and
Chart::instrument again when they change. A missing instrument
or a non-positive, non-finite or missing tick size hides the tab. Before the first call,
all layers are offered. Hidden controls retain their saved values.
Sourcepub fn open(&mut self, settings: ChartSettingsState)
pub fn open(&mut self, settings: ChartSettingsState)
Open the dialog with the supplied state.
Sourcepub fn settings(&self) -> &ChartSettingsState
pub fn settings(&self) -> &ChartSettingsState
Read the display settings being edited.
Sourcepub fn show(&mut self, ctx: &Context, theme: &Theme) -> SettingsAction
pub fn show(&mut self, ctx: &Context, theme: &Theme) -> SettingsAction
Show the dialog and return the requested action.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SettingsDialog
impl !UnwindSafe for SettingsDialog
impl Freeze for SettingsDialog
impl Send for SettingsDialog
impl Sync for SettingsDialog
impl Unpin for SettingsDialog
impl UnsafeUnpin for SettingsDialog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more