#[non_exhaustive]pub enum DrawingToolbarAction {
Show 29 variants
None,
SelectTool(DrawingToolType),
SetCursorType(CursorType),
ToggleMagnet,
ToggleStayInDrawingMode,
ClearAllDrawings,
ColorChanged([u8; 4]),
ToggleEraserMode,
HideAllDrawings,
HideAllIndicators,
HideAllPoss,
HideAllOrders,
RemoveAllDrawings,
RemoveAllIndicators,
RemoveAllStudies,
HideAll,
RemoveDrawingsAndIndicators,
SetMagnetType(MagnetType),
SetSnapToIndicators(bool),
ZoomIn,
ZoomOut,
ToggleValuesTooltip,
LockAllDrawings,
SaveTemplate {
name: String,
},
LoadTemplate {
template_id: String,
},
OpenTemplateMenu,
ManageTemplates,
InsertGlyph {
icon_name: &'static str,
size: f32,
},
InsertEmoji {
icon_name: &'static str,
},
}Expand description
Actions returned from toolbar interactions
§Examples
use egui_charts::ui::drawing_toolbar::DrawingToolbarAction;
use egui_charts::drawings::DrawingToolType;
let action = DrawingToolbarAction::SelectTool(DrawingToolType::TrendLine);
match action {
DrawingToolbarAction::SelectTool(tool) => {
println!("Selected tool: {:?}", tool);
}
_ => {}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
No action taken
SelectTool(DrawingToolType)
A drawing tool was selected
SetCursorType(CursorType)
Set cursor type (Cross, Dot, Arrow, Magic)
ToggleMagnet
Magnet mode toggled, from a click on the magnet or its Off row
ToggleStayInDrawingMode
Stay-in-drawing mode toggled
ClearAllDrawings
Clear all drawings requested
ColorChanged([u8; 4])
Drawing color changed (RGBA)
ToggleEraserMode
Eraser mode toggled
HideAllDrawings
Hide all drawings
HideAllIndicators
Hide all indicators
HideAllPoss
Hide all positions
HideAllOrders
Hide all orders
RemoveAllDrawings
Remove all drawings
RemoveAllIndicators
Remove all indicators
RemoveAllStudies
Remove all studies (indicators + overlays)
HideAll
Hide drawings, indicators, positions and orders at once. A host applies it as it
applies HideAllDrawings, HideAllIndicators, HideAllPoss and HideAllOrders with
everything hidden, in one undo step.
RemoveDrawingsAndIndicators
Remove all drawings and all indicators at once. A host applies it as it applies
RemoveAllDrawings and RemoveAllIndicators, in one undo step.
SetMagnetType(MagnetType)
Change magnet type (Weak/Strong)
SetSnapToIndicators(bool)
Include or exclude visible study plots from drawing magnet targets.
Hosts set DrawingManagerOptions::snap_to_indicators to this value.
ZoomIn
Zoom in (save current state to history)
ZoomOut
Zoom out (restore previous state from history)
ToggleValuesTooltip
Toggle values tooltip on long press
LockAllDrawings
Lock all drawings
SaveTemplate
Save current drawing properties as a template
LoadTemplate
Load a previously saved drawing template
OpenTemplateMenu
Open the template name input.
ManageTemplates
Open the host’s drawing template catalog for loading and deletion.
InsertGlyph
Place a bundled icon, emoji or sticker at its independent pixel size.
Fields
InsertEmoji
Legacy host intent for an emoji at the configured default size.
Trait Implementations§
Source§impl Clone for DrawingToolbarAction
impl Clone for DrawingToolbarAction
Source§fn clone(&self) -> DrawingToolbarAction
fn clone(&self) -> DrawingToolbarAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DrawingToolbarAction
impl Debug for DrawingToolbarAction
Source§impl PartialEq for DrawingToolbarAction
impl PartialEq for DrawingToolbarAction
impl StructuralPartialEq for DrawingToolbarAction
Auto Trait Implementations§
impl Freeze for DrawingToolbarAction
impl RefUnwindSafe for DrawingToolbarAction
impl Send for DrawingToolbarAction
impl Sync for DrawingToolbarAction
impl Unpin for DrawingToolbarAction
impl UnsafeUnpin for DrawingToolbarAction
impl UnwindSafe for DrawingToolbarAction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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