Dir name in title of window

This commit is contained in:
Piyush मिश्रः 2022-03-25 14:09:57 +05:30
parent 59aec4ab3b
commit fadf6e68e1
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@ use fltk::{
valuator::{Slider, SliderType},
window::Window,
};
use std::ffi::OsStr;
use std::path::PathBuf;
use std::sync::{mpsc, RwLock};
use std::{ fs, sync::Arc};
@ -405,6 +406,7 @@ impl MainWindow {
let mut file_choice = self.file_choice.clone();
let sender = self.sender.clone();
let imgs = Arc::clone(&self.images_list);
let mut win = self.win.clone();
self.menubar.add(
"&File/Open Folder...\t",
Shortcut::Ctrl | 'o',
@ -425,6 +427,7 @@ impl MainWindow {
return;
}
}
win.set_label(&format!("{} - Post Maker", path.file_name().unwrap_or(OsStr::new("Unknown")).to_string_lossy()));
load_dir(&path, Arc::clone(&imgs), &mut file_choice, &sender);
},
);