pub enum RightClickTarget {
Element {
id: ChartElementId,
bar_idx: usize,
pos: Pos2,
price: f64,
},
Drawing {
drawing_id: usize,
pos: Pos2,
},
Background {
pos: Pos2,
price: f64,
},
}Expand description
The object a right-click landed on, with the data needed to position and populate a context menu.
Captured during Chart::show/Chart::show_with_indicators when the user
right-clicks inside the chart area. Drain it once per frame with
Chart::take_right_click. Right-clicking also selects the hit object (the
same as a left click) so selection handles and the menu stay consistent, the
way TradingView behaves.
This type intentionally carries no ui-feature types, so the core chart can
surface right-clicks even when built with --no-default-features; the host
(or the ui-gated turnkey menu in TradingChart) maps it to a concrete
menu.
Variants§
Element
A series or overlay/pane indicator line was hit.
Fields
id: ChartElementIdThe selected chart element (series or indicator).
Drawing
A drawing object was hit. The drawing is identified by its
crate::drawings::DrawingManager id.
Fields
Background
Empty chart area was hit (no series, indicator, or drawing).
Trait Implementations§
Source§impl Clone for RightClickTarget
impl Clone for RightClickTarget
Source§fn clone(&self) -> RightClickTarget
fn clone(&self) -> RightClickTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RightClickTarget
Source§impl Debug for RightClickTarget
impl Debug for RightClickTarget
Source§impl PartialEq for RightClickTarget
impl PartialEq for RightClickTarget
Source§fn eq(&self, other: &RightClickTarget) -> bool
fn eq(&self, other: &RightClickTarget) -> bool
self and other values to be equal, and is used by ==.