pub struct ToolbarState {Show 31 fields
pub sel_tool: Option<DrawingToolType>,
pub expanded: bool,
pub expanded_category: Option<String>,
pub favorites: Vec<DrawingToolType>,
pub floating_visible: bool,
pub floating_pos: Option<Pos2>,
pub recent: VecDeque<DrawingToolType>,
pub magnet_mode: bool,
pub magnet_type: MagnetType,
pub snap_to_indicators: bool,
pub magnet_hint_dismissed: bool,
pub stay_in_drawing_mode: bool,
pub drawing_color: [u8; 4],
pub show_color_picker: bool,
pub category_last_tool: HashMap<String, DrawingToolType>,
pub search_open: bool,
pub search_query: String,
pub glyph_picker: GlyphPicker,
pub values_tooltip_on_long_press: bool,
pub eraser_mode_enabled: bool,
pub lock_all: bool,
pub hide_drawings: bool,
pub hide_indicators: bool,
pub hide_positions: bool,
pub hide_orders: bool,
pub has_zoom_history: bool,
pub zoom_mode_active: bool,
pub current_cursor_type: CursorType,
pub templates: Vec<DrawingTemplate>,
pub show_template_name_input: bool,
pub template_name_input: String,
}Expand description
Drawing toolbar state
Fields§
§sel_tool: Option<DrawingToolType>Currently selected tool
expanded: boolWhether the toolbar is expanded (shows names)
expanded_category: Option<String>Currently expanded category (for nested menus)
favorites: Vec<DrawingToolType>Favorite tools, in the order they were starred
floating_visible: boolWhether the floating strip of favorite tools is shown while there are favorites
floating_pos: Option<Pos2>Top-left corner of the floating strip, which the user can drag; None until it has been
shown, when it starts beside the toolbar
recent: VecDeque<DrawingToolType>Recently used tools (max 5)
magnet_mode: boolWhether drawing anchors snap to nearby chart values and drawing points
magnet_type: MagnetTypeType of magnet snapping when magnet mode is enabled
snap_to_indicators: boolWhether magnet targets include visible study plots; independent of its strength.
magnet_hint_dismissed: boolWhether the user dismissed the card that explains the magnet. Until then the card shows
beside the magnet button each time the user switches snapping on from the toolbar. Keep it
with the user’s settings, as UserSettings::magnet_hint_dismissed; set it to leave the
card out.
stay_in_drawing_mode: boolStay in drawing mode after placing tool
drawing_color: [u8; 4]Currently selected drawing color
show_color_picker: boolWhether to show the color picker popup
category_last_tool: HashMap<String, DrawingToolType>Last selected tool per category (remembers which tool was last used in each category)
search_open: boolWhether the tool search bar is open
search_query: StringCurrent search query
glyph_picker: GlyphPickerGlyph picker search, size and session recents.
values_tooltip_on_long_press: boolWhether to show values tooltip on long press
eraser_mode_enabled: boolWhether eraser mode is currently active
lock_all: boolWhether all drawings are locked; the lock button shows it.
hide_drawings: boolWhether the Hide menu has hidden drawings; the menu shows a check on each hidden group.
hide_indicators: boolWhether the Hide menu has hidden indicators.
hide_positions: boolWhether the Hide menu has hidden positions.
hide_orders: boolWhether the Hide menu has hidden orders.
has_zoom_history: boolWhether zoom history exists (for showing/hiding Zoom Out button)
zoom_mode_active: boolWhether zoom-in mode is currently active (for button highlighting)
current_cursor_type: CursorTypeCurrent cursor type (Cross, Dot, Arrow) - Arrow is default
templates: Vec<DrawingTemplate>Cached drawing templates loaded from the API
show_template_name_input: boolWhether the template name input dialog is showing
template_name_input: StringCurrent template name being entered
Implementations§
Source§impl ToolbarState
impl ToolbarState
Sourcepub fn select_tool(&mut self, tool: DrawingToolType)
pub fn select_tool(&mut self, tool: DrawingToolType)
Select a drawing tool and add to recent
Sourcepub fn add_to_recent(&mut self, tool: DrawingToolType)
pub fn add_to_recent(&mut self, tool: DrawingToolType)
Add a tool to recent list
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear tool selection (cursor mode)
Sourcepub fn toggle_favorite(&mut self, tool: DrawingToolType)
pub fn toggle_favorite(&mut self, tool: DrawingToolType)
Toggle favorite status of a tool
Sourcepub fn is_favorite(&self, tool: &DrawingToolType) -> bool
pub fn is_favorite(&self, tool: &DrawingToolType) -> bool
Check if tool is favorited
Sourcepub fn toggle_magnet(&mut self)
pub fn toggle_magnet(&mut self)
Toggle magnet mode
Sourcepub fn toggle_stay_in_drawing(&mut self)
pub fn toggle_stay_in_drawing(&mut self)
Toggle stay-in-drawing mode
Trait Implementations§
Source§impl Clone for ToolbarState
impl Clone for ToolbarState
Source§fn clone(&self) -> ToolbarState
fn clone(&self) -> ToolbarState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ToolbarState
impl RefUnwindSafe for ToolbarState
impl Send for ToolbarState
impl Sync for ToolbarState
impl Unpin for ToolbarState
impl UnsafeUnpin for ToolbarState
impl UnwindSafe for ToolbarState
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