FileDialogState

Struct FileDialogState 

Source
pub struct FileDialogState {
    pub area: Rect,
    pub active: bool,
    /* private fields */
}
Expand description

State & event-handling.

Fields§

§area: Rect

Area read only renewed with each render.

§active: bool

Dialog is active.

Implementations§

Source§

impl FileDialogState

Source

pub fn new() -> Self

Source

pub fn active(&self) -> bool

Source

pub fn set_filter(&mut self, filter: impl Fn(&Path) -> bool + 'static)

Set a filter.

Source

pub fn set_last_path(&mut self, last: &Path)

Set the last path. This will be shown in the roots list. And it will be the preferred start directory instead of the one given Self::open_dialog, Self::directory_dialog and Self::save_dialog.

Source

pub fn use_default_roots(&mut self, roots: bool)

Use the default set of roots.

Source

pub fn no_default_roots(&mut self)

Don’t use default set of roots.

Source

pub fn add_root(&mut self, name: impl AsRef<str>, path: impl Into<PathBuf>)

Add a root path.

Source

pub fn clear_roots(&mut self)

Clear all roots.

Source

pub fn default_roots(&mut self, start: &Path, last: &Path)

Append the default roots.

Source

pub fn directory_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>

Show as directory-dialog.

Source

pub fn open_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>

Show as open-dialog.

Source

pub fn open_many_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>

Show as open-dialog with multiple selection

Source

pub fn save_dialog( &mut self, path: impl AsRef<Path>, name: impl AsRef<str>, ) -> Result<(), Error>

Show as save-dialog.

Source

pub fn save_dialog_ext( &mut self, path: impl AsRef<Path>, name: impl AsRef<str>, ext: impl AsRef<str>, ) -> Result<(), Error>

Show as save-dialog.

Trait Implementations§

Source§

impl Clone for FileDialogState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileDialogState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FileDialogState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HandleEvent<Event, Dialog, Result<FileOutcome, Error>> for FileDialogState

Source§

fn handle( &mut self, event: &Event, _qualifier: Dialog, ) -> Result<FileOutcome, Error>

Handle an event. Read more
Source§

impl HasFocus for FileDialogState

Source§

fn build(&self, _builder: &mut FocusBuilder)

Build the focus-structure for the container.
Source§

fn focus(&self) -> FocusFlag

Access to the flag for the rest.
Source§

fn area(&self) -> Rect

Area for mouse focus. Read more
Source§

fn id(&self) -> usize

Provide a unique id for the widget.
Source§

fn area_z(&self) -> u16

Z value for the area. Read more
Source§

fn navigable(&self) -> Navigation

Declares how the widget interacts with focus. Read more
Source§

fn is_focused(&self) -> bool

Focused?
Source§

fn lost_focus(&self) -> bool

Just lost focus.
Source§

fn gained_focus(&self) -> bool

Just gained focus.
Source§

impl HasScreenCursor for FileDialogState

Source§

fn screen_cursor(&self) -> Option<(u16, u16)>

This returns the cursor position if Read more
Source§

impl RelocatableState for FileDialogState

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Relocate the areas in this widgets state. Read more
Source§

fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)

Relocate only popup areas. As rendering the popups is a separate render, this has to be separate too.
Source§

fn relocate_popup_hidden(&mut self)

Relocate all popup areas to a clip-rect (0,0+0x0).
Source§

fn relocate_hidden(&mut self)

Relocate all areas to a clip-rect (0,0+0x0).

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.