Skip to main content

Dialog

Struct Dialog 

Source
pub struct Dialog { /* private fields */ }
Expand description

High-level dialog wrapper for creating and controlling native dialogs.

Implementations§

Source§

impl Dialog

Source

pub fn new() -> ArkUIResult<Self>

Create a new dialog controller.

Source

pub fn content<T: Into<ArkUINode>>(&self, content: T) -> ArkUIResult<()>

Set dialog content node.

Source

pub fn show(&self) -> ArkUIResult<()>

Show the dialog in current window.

Source

pub fn show_with_sub_window(&self) -> ArkUIResult<()>

Show the dialog in sub-window mode.

Source

pub fn close(&self) -> ArkUIResult<()>

Close the dialog.

Source

pub fn modal_mode(&self, modal_mode: bool) -> ArkUIResult<()>

Source

pub fn auto_cancel(&self, auto_cancel: bool) -> ArkUIResult<()>

Source

pub fn background_color(&self, color: u32) -> ArkUIResult<()>

Source

pub fn content_alignment(&self, alignment: Alignment) -> ArkUIResult<()>

Set content alignment, offset_x and offset_y will be set with 0.0

Source

pub fn content_alignment_with_offset( &self, alignment: Alignment, offset_x: f32, offset_y: f32, ) -> ArkUIResult<()>

Set content alignment with offset_x and offset_y.

Source

pub fn corner_radius( &self, top_left: f32, top_right: f32, bottom_left: f32, bottom_right: f32, ) -> ArkUIResult<()>

Source

pub fn on_will_dismiss( &self, callback: fn(DialogDismissData) -> Option<bool>, ) -> ArkUIResult<()>

Source

pub fn on_will_dismiss_with_data<T: 'static>( &self, data: T, callback: fn(data: DialogDismissData) -> Option<bool>, ) -> ArkUIResult<()>

For user custom data, you can use this method And you need to convert raw pointer to your data type after callback

Auto Trait Implementations§

§

impl !RefUnwindSafe for Dialog

§

impl !Send for Dialog

§

impl !Sync for Dialog

§

impl !UnwindSafe for Dialog

§

impl Freeze for Dialog

§

impl Unpin for Dialog

§

impl UnsafeUnpin for Dialog

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.