pub struct FloatingReplayControl {
pub state: ReplayControlState,
/* private fields */
}Expand description
Floating replay control widget
Fields§
§state: ReplayControlStateCurrent state (public for external access)
Implementations§
Source§impl FloatingReplayControl
impl FloatingReplayControl
Sourcepub fn set_dock_rect(&mut self, rect: Rect)
pub fn set_dock_rect(&mut self, rect: Rect)
Dock the bar in rect, usually the chart’s rect.
The bar opens centred at the bottom of this rect and can be dragged only within it. Call
it before Self::show in each frame; without it the bar docks in the window’s content
rect.
Sourcepub fn set_update_intervals(
&mut self,
current: Timeframe,
available: Vec<Timeframe>,
)
pub fn set_update_intervals( &mut self, current: Timeframe, available: Vec<Timeframe>, )
Supplies source intervals the host can serve. An empty list hides the selector.
Selecting one emits an intent; the host reloads that source and retains the cursor time.
Offer Timeframe::Ticks of one for trade-by-trade updates when the host holds the trades
(see Chart::set_replay_source).
Sourcepub fn show_control(&mut self)
pub fn show_control(&mut self)
Show the control (clears user_dismissed flag)
Sourcepub fn hide_control(&mut self)
pub fn hide_control(&mut self)
Hide the control
Sourcepub fn dismiss(&mut self)
pub fn dismiss(&mut self)
Hide control via user action (sets user_dismissed flag to prevent auto-show)
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if visible
Sourcepub fn is_user_dismissed(&self) -> bool
pub fn is_user_dismissed(&self) -> bool
Check if user explicitly dismissed (prevents auto-show)
Sourcepub fn update_state(&mut self, state: ReplayControlState)
pub fn update_state(&mut self, state: ReplayControlState)
Update the state
Sourcepub fn set_playing(&mut self, playing: bool)
pub fn set_playing(&mut self, playing: bool)
Set playing state
Sourcepub fn sync_from(
&mut self,
active: bool,
playing: bool,
speed: f32,
current_bar: usize,
total_bars: usize,
)
pub fn sync_from( &mut self, active: bool, playing: bool, speed: f32, current_bar: usize, total_bars: usize, )
Sync replay control state from external values.
Drives visibility and playback display from central replay state.
Sourcepub fn set_symbol(&mut self, symbol: &str)
pub fn set_symbol(&mut self, symbol: &str)
Set symbol
Sourcepub fn show(&mut self, ctx: &Context) -> ReplayControlAction
pub fn show(&mut self, ctx: &Context) -> ReplayControlAction
Show the floating control and return any action
Sourcepub fn shortcut(&self, ctx: &Context) -> ReplayControlAction
pub fn shortcut(&self, ctx: &Context) -> ReplayControlAction
The action of a shortcut pressed this frame, which takes its key.
Shortcuts act only while no text field has focus, no popup is open and no control outside the background layer has focus, so keys typed into a field, meant for an open popup or pressing a focused button in the bar or a dialog never reach the replay. A focused chart in a panel keeps them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FloatingReplayControl
impl RefUnwindSafe for FloatingReplayControl
impl Send for FloatingReplayControl
impl Sync for FloatingReplayControl
impl Unpin for FloatingReplayControl
impl UnsafeUnpin for FloatingReplayControl
impl UnwindSafe for FloatingReplayControl
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