pub struct FileDialogState {
pub area: Rect,
pub active: bool,
/* private fields */
}Expand description
State & event-handling.
Fields§
§area: RectArea read only renewed with each render.
active: boolDialog is active.
Implementations§
Source§impl FileDialogState
impl FileDialogState
pub fn new() -> Self
pub fn active(&self) -> bool
Sourcepub fn set_filter(&mut self, filter: impl Fn(&Path) -> bool + 'static)
pub fn set_filter(&mut self, filter: impl Fn(&Path) -> bool + 'static)
Set a filter.
Sourcepub fn set_last_path(&mut self, last: &Path)
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.
Sourcepub fn use_default_roots(&mut self, roots: bool)
pub fn use_default_roots(&mut self, roots: bool)
Use the default set of roots.
Sourcepub fn no_default_roots(&mut self)
pub fn no_default_roots(&mut self)
Don’t use default set of roots.
Sourcepub fn clear_roots(&mut self)
pub fn clear_roots(&mut self)
Clear all roots.
Sourcepub fn default_roots(&mut self, start: &Path, last: &Path)
pub fn default_roots(&mut self, start: &Path, last: &Path)
Append the default roots.
Sourcepub fn directory_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn directory_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Show as directory-dialog.
Sourcepub fn open_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn open_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Show as open-dialog.
Sourcepub fn open_many_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn open_many_dialog(&mut self, path: impl AsRef<Path>) -> Result<(), Error>
Show as open-dialog with multiple selection
Trait Implementations§
Source§impl Clone for FileDialogState
impl Clone for FileDialogState
Source§impl Debug for FileDialogState
impl Debug for FileDialogState
Source§impl Default for FileDialogState
impl Default for FileDialogState
Source§impl HandleEvent<Event, Dialog, Result<FileOutcome, Error>> for FileDialogState
impl HandleEvent<Event, Dialog, Result<FileOutcome, Error>> for FileDialogState
Source§impl HasFocus for FileDialogState
impl HasFocus for FileDialogState
Source§fn build(&self, _builder: &mut FocusBuilder)
fn build(&self, _builder: &mut FocusBuilder)
Build the focus-structure for the container.
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
Source§impl HasScreenCursor for FileDialogState
impl HasScreenCursor for FileDialogState
Source§impl RelocatableState for FileDialogState
impl RelocatableState for FileDialogState
Source§fn relocate(&mut self, shift: (i16, i16), clip: Rect)
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)
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.
Relocate all popup areas to a clip-rect (0,0+0x0).
Relocate all areas to a clip-rect (0,0+0x0).
Auto Trait Implementations§
impl !Freeze for FileDialogState
impl !RefUnwindSafe for FileDialogState
impl !Send for FileDialogState
impl !Sync for FileDialogState
impl Unpin for FileDialogState
impl !UnwindSafe for FileDialogState
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
Mutably borrows from an owned value. Read more
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>
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 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>
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