Skip to content

Commit

Permalink
Deps: Use nfd2 crate instead of the nfd-rs
Browse files Browse the repository at this point in the history
Apparently the "nfd-rs" crate has been superseded by a newer version
that is more actively maintained + contains a number of bugfixes.
  • Loading branch information
Aligorith committed Dec 29, 2021
1 parent 1fbb1a8 commit d3ea07c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
16 changes: 5 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ usvg = "0.14.1"
tiny-skia = "0.5.1"
log = "0.4"
env_logger = "0.8"
nfd = "0.0.4"
nfd2 = "0.3.0"

[dependencies.libavif-image]
version = "0.6.0"
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/picture_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::rc::{Rc, Weak};
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};

extern crate nfd;
use nfd::Response;
extern crate nfd2;
use nfd2::Response;

use gelatin::cgmath::{Matrix4, Vector2, Vector3};
use gelatin::glium::glutin::event::{ElementState, ModifiersState, MouseButton};
Expand Down Expand Up @@ -623,8 +623,8 @@ impl PictureWidget {
}
}
if triggered!(IMG_BROWSE_NAME) {
match nfd::open_file_dialog(None, None).expect("file dialog error") {
// TODO: Restrict to only supported image types
match nfd2::open_file_dialog(None, None).expect("file dialog error") {
Response::Okay(file_path) => {
println!("Selected File Path = {:?}", file_path);
let file_path_buf = PathBuf::from(file_path.clone());
Expand Down

0 comments on commit d3ea07c

Please sign in to comment.