diff options
Diffstat (limited to 'src/file_browser.rs')
-rw-r--r-- | src/file_browser.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/file_browser.rs b/src/file_browser.rs index 34ddd32..d1c597c 100644 --- a/src/file_browser.rs +++ b/src/file_browser.rs @@ -18,6 +18,7 @@ use crate::fail::{HResult, HError, ErrorLog}; use crate::widget::{Events, WidgetCore}; use crate::proclist::ProcView; use crate::bookmarks::BMPopup; +use crate::term::ScreenExt; #[derive(PartialEq)] pub enum FileBrowserWidgets { @@ -339,6 +340,12 @@ impl FileBrowser { Ok(()) } + pub fn set_title(&self) -> HResult<()> { + let cwd = &self.cwd.path.to_string_lossy(); + self.core.screen.lock()?.set_title(cwd)?; + Ok(()) + } + pub fn update_preview(&mut self) -> HResult<()> { if !self.main_widget()?.ready() { return Ok(()) } let file = self.selected_file()?.clone(); @@ -680,6 +687,7 @@ impl Widget for FileBrowser { } fn refresh(&mut self) -> HResult<()> { //self.proc_view.lock()?.set_coordinates(self.get_coordinates()?); + self.set_title().ok(); self.handle_dir_events().ok(); self.columns.refresh().ok(); self.set_left_selection().log(); |