Skip to content

Commit

Permalink
Add selected function, update default window size
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxcode committed Jan 31, 2024
1 parent b7821ba commit fce3bbe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ impl FileDialog {
self.state.clone()
}

pub fn selected(&self) -> Option<&Path> {
match &self.state {
DialogState::Selected(path) => Some(path),
_ => None
}
}

pub fn update(&mut self, ctx: &egui::Context) -> &Self {
if self.state != DialogState::Open {
return self;
Expand All @@ -146,7 +153,7 @@ impl FileDialog {

egui::Window::new(&self.window_title)
.open(&mut is_open)
.default_size([800.0, 500.0])
.default_size([650.0, 370.0])
.min_width(335.0)
.min_height(200.0)
.collapsible(false)
Expand Down

0 comments on commit fce3bbe

Please sign in to comment.