Skip to main content

SettingsDialog

Struct SettingsDialog 

Source
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: bool

Whether 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

Source

pub fn new() -> Self

Create a SettingsDialog with default settings.

Source

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.

Source

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.

Source

pub fn open(&mut self, settings: ChartSettingsState)

Open the dialog with the supplied state.

Source

pub fn close(&mut self)

Close the dialog.

Source

pub fn settings(&self) -> &ChartSettingsState

Read the display settings being edited.

Source

pub fn show(&mut self, ctx: &Context, theme: &Theme) -> SettingsAction

Show the dialog and return the requested action.

Trait Implementations§

Source§

impl Default for SettingsDialog

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.