pub struct DrawingPropertiesDialog {
pub config: DrawingPropertiesConfig,
pub is_open: bool,
pub drawing_id: Option<DrawingId>,
pub drawing_name: String,
pub active_tab: PropertiesTab,
pub props: DrawingProps,
pub coordinates: CoordinatesState,
pub templates: TemplateStore<DrawingTemplate>,
pub error: Option<String>,
/* private fields */
}Expand description
Drawing properties dialog
Fields§
§config: DrawingPropertiesConfigDisplay and layout options for this component.
is_open: boolWhether the dialog is currently visible.
drawing_id: Option<DrawingId>Identifier of the drawing being edited, when open.
drawing_name: StringDisplay name of the drawing being edited.
active_tab: PropertiesTabCurrently selected tab.
props: DrawingPropsEditable drawing appearance and tool settings.
coordinates: CoordinatesStateEditable drawing anchors.
templates: TemplateStore<DrawingTemplate>Named templates, kept in memory unless the host attaches its storage service.
error: Option<String>Validation error from the most recent edit.
Implementations§
Source§impl DrawingPropertiesDialog
impl DrawingPropertiesDialog
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a DrawingPropertiesDialog with default settings.
Sourcepub fn open(&mut self, id: DrawingId, name: String, props: DrawingProps)
pub fn open(&mut self, id: DrawingId, name: String, props: DrawingProps)
Open the dialog for a specific drawing
Sourcepub fn open_for_chart(&mut self, chart: &Chart, id: DrawingId) -> bool
pub fn open_for_chart(&mut self, chart: &Chart, id: DrawingId) -> bool
Open with the selected drawing’s saved properties and all of its coordinates.
Sourcepub fn show_and_apply(
&mut self,
ctx: &Context,
chart: &mut Chart,
) -> DrawingPropertiesAction
pub fn show_and_apply( &mut self, ctx: &Context, chart: &mut Chart, ) -> DrawingPropertiesAction
Preview validated edits while open; Ok commits one undoable edit and Cancel restores the original properties. Apply is a notification the host must not apply a second time. Call every frame, including after closing externally, to restore an unfinished preview.
Sourcepub fn sync_open_state(&mut self, should_be_open: bool)
pub fn sync_open_state(&mut self, should_be_open: bool)
Sync dialog open/close state from an external flag.
Opening requires drawing context, so only close is synced here.
Sourcepub fn show(&mut self, ctx: &Context) -> DrawingPropertiesAction
pub fn show(&mut self, ctx: &Context) -> DrawingPropertiesAction
Show the dialog
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DrawingPropertiesDialog
impl !UnwindSafe for DrawingPropertiesDialog
impl Freeze for DrawingPropertiesDialog
impl Send for DrawingPropertiesDialog
impl Sync for DrawingPropertiesDialog
impl Unpin for DrawingPropertiesDialog
impl UnsafeUnpin for DrawingPropertiesDialog
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