Struct floem::file::FileDialogOptions
source · pub struct FileDialogOptions { /* private fields */ }
Implementations§
source§impl FileDialogOptions
impl FileDialogOptions
sourcepub fn new() -> FileDialogOptions
pub fn new() -> FileDialogOptions
Create a new set of options.
Set hidden files and directories to be visible.
sourcepub fn select_directories(self) -> Self
pub fn select_directories(self) -> Self
Set directories to be selectable instead of files.
This is only relevant for open dialogs.
sourcepub fn packages_as_directories(self) -> Self
pub fn packages_as_directories(self) -> Self
Set packages to be treated as directories instead of files.
This allows for writing more universal cross-platform code at the cost of user experience.
This is only relevant on macOS.
sourcepub fn multi_selection(self) -> Self
pub fn multi_selection(self) -> Self
Set multiple items to be selectable.
This is only relevant for open dialogs.
sourcepub fn allowed_types(self, types: Vec<FileSpec>) -> Self
pub fn allowed_types(self, types: Vec<FileSpec>) -> Self
Set the file types the user is allowed to select.
This filter is only applied to files and packages, but not to directories.
An empty collection is treated as no filter.
macOS
These file types also apply to directories to define packages. Which means the directories that match the filter are no longer considered directories. The packages are defined by this collection even in directories mode.
sourcepub fn default_type(self, default_type: FileSpec) -> Self
pub fn default_type(self, default_type: FileSpec) -> Self
Set the default file type.
The provided default_type
must also be present in allowed_types
.
If it’s None
then the first entry in allowed_types
will be used as the default.
This is only relevant in files mode.
sourcepub fn default_name(self, default_name: impl Into<String>) -> Self
pub fn default_name(self, default_name: impl Into<String>) -> Self
Set the default filename that appears in the dialog.
sourcepub fn name_label(self, name_label: impl Into<String>) -> Self
pub fn name_label(self, name_label: impl Into<String>) -> Self
Set the text in the label next to the filename editbox.
Set the text of the Open/Save button.
sourcepub fn force_starting_directory(self, path: impl Into<PathBuf>) -> Self
pub fn force_starting_directory(self, path: impl Into<PathBuf>) -> Self
Force the starting directory to the specified path
.
User experience
This should almost never be used because it overrides the OS choice, which will usually be a directory that the user recently visited.
Trait Implementations§
source§impl Clone for FileDialogOptions
impl Clone for FileDialogOptions
source§fn clone(&self) -> FileDialogOptions
fn clone(&self) -> FileDialogOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FileDialogOptions
impl Debug for FileDialogOptions
source§impl Default for FileDialogOptions
impl Default for FileDialogOptions
source§fn default() -> FileDialogOptions
fn default() -> FileDialogOptions
Auto Trait Implementations§
impl RefUnwindSafe for FileDialogOptions
impl Send for FileDialogOptions
impl Sync for FileDialogOptions
impl Unpin for FileDialogOptions
impl UnwindSafe for FileDialogOptions
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.