pub struct FileDialog { /* private fields */ }Expand description
egui component that represents OpenFileDialog or SaveFileDialog.
Implementations§
Source§impl FileDialog
impl FileDialog
Sourcepub fn select_folder(initial_path: Option<PathBuf>) -> FileDialog
pub fn select_folder(initial_path: Option<PathBuf>) -> FileDialog
Create dialog that prompts the user to select a folder.
Sourcepub fn open_file(initial_path: Option<PathBuf>) -> FileDialog
pub fn open_file(initial_path: Option<PathBuf>) -> FileDialog
Create dialog that prompts the user to open a file.
Sourcepub fn save_file(initial_path: Option<PathBuf>) -> FileDialog
pub fn save_file(initial_path: Option<PathBuf>) -> FileDialog
Create dialog that prompts the user to save a file.
Sourcepub fn default_filename(self, filename: impl Into<String>) -> FileDialog
pub fn default_filename(self, filename: impl Into<String>) -> FileDialog
Set the default file name.
Sourcepub fn title(self, title: &str) -> FileDialog
pub fn title(self, title: &str) -> FileDialog
Set the window title text.
Sourcepub fn id(self, id: impl Into<Id>) -> FileDialog
pub fn id(self, id: impl Into<Id>) -> FileDialog
Set the window ID.
Sourcepub fn anchor(self, align: Align2, offset: impl Into<Vec2>) -> FileDialog
pub fn anchor(self, align: Align2, offset: impl Into<Vec2>) -> FileDialog
Set the window anchor.
Sourcepub fn current_pos(self, current_pos: impl Into<Pos2>) -> FileDialog
pub fn current_pos(self, current_pos: impl Into<Pos2>) -> FileDialog
Set the window position.
Sourcepub fn default_size(self, default_size: impl Into<Vec2>) -> FileDialog
pub fn default_size(self, default_size: impl Into<Vec2>) -> FileDialog
Set the window default size.
Sourcepub fn resizable(self, resizable: bool) -> FileDialog
pub fn resizable(self, resizable: bool) -> FileDialog
Enable/disable resizing the window. Default is true.
Sourcepub fn show_rename(self, rename: bool) -> FileDialog
pub fn show_rename(self, rename: bool) -> FileDialog
Show the Rename button. Default is true.
Sourcepub fn show_new_folder(self, new_folder: bool) -> FileDialog
pub fn show_new_folder(self, new_folder: bool) -> FileDialog
Show the New Folder button. Default is true.
Sourcepub fn filter(
self,
filter: Box<dyn Fn(&Path) -> bool + Sync + Send>,
) -> FileDialog
pub fn filter( self, filter: Box<dyn Fn(&Path) -> bool + Sync + Send>, ) -> FileDialog
Set a function to filter shown files.
Sourcepub fn edit_focus(
self,
edit_focus: Box<dyn Fn(bool) + Sync + Send>,
) -> FileDialog
pub fn edit_focus( self, edit_focus: Box<dyn Fn(bool) + Sync + Send>, ) -> FileDialog
Calls the edit_focus function when a text edit gains or looses focus.
Sourcepub fn dialog_type(&self) -> DialogType
pub fn dialog_type(&self) -> DialogType
Get the dialog type.
Sourcepub fn show(&mut self, ctx: &Context) -> &FileDialog
pub fn show(&mut self, ctx: &Context) -> &FileDialog
Shows the dialog if it is open. It is also responsible for state management. Should be called every ui update.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FileDialog
impl !UnwindSafe for FileDialog
impl Freeze for FileDialog
impl Send for FileDialog
impl Sync for FileDialog
impl Unpin for FileDialog
impl UnsafeUnpin for FileDialog
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.