diff --git a/src/JPEGView/FileList.cpp b/src/JPEGView/FileList.cpp index 3ae475fd..22b7b7d5 100644 --- a/src/JPEGView/FileList.cpp +++ b/src/JPEGView/FileList.cpp @@ -585,6 +585,28 @@ LPCTSTR CFileList::CurrentDirectory() const { } } +CString CFileList::CurrentDirectoryName() const { + if (m_sDirectory.GetLength() > 0) { + int pos = m_sDirectory.ReverseFind('\\'); + if (pos >= 0) + { + int cnt = m_sDirectory.GetLength() - pos - 1; + if (cnt > 0) + return m_sDirectory.Right(cnt); + } + } + return m_sDirectory; +} + +CString CFileList::CurrentDirectoryNameShort() const { + CString name = CurrentDirectoryName(); + int len = name.GetLength(); + if (len <= 44) + return name; + + return name.Left(10) + "..." + name.Right(10); +} + int CFileList::CurrentIndex() const { int i = 0; std::list::const_iterator iter; diff --git a/src/JPEGView/FileList.h b/src/JPEGView/FileList.h index 298b2e82..0cc906ca 100644 --- a/src/JPEGView/FileList.h +++ b/src/JPEGView/FileList.h @@ -98,6 +98,10 @@ class CFileList LPCTSTR CurrentFileTitle() const; // Current directory without file name, NULL if none LPCTSTR CurrentDirectory() const; + // Current directory's base name + CString CurrentDirectoryName() const; + // Current directory's base name shortened if too long + CString CurrentDirectoryNameShort() const; // Modification time of current file const FILETIME* CurrentModificationTime() const; // Get the n-next file, does not change the internal state diff --git a/src/JPEGView/MainDlg.cpp b/src/JPEGView/MainDlg.cpp index 6eb20fdc..16c8b2e8 100644 --- a/src/JPEGView/MainDlg.cpp +++ b/src/JPEGView/MainDlg.cpp @@ -3187,11 +3187,19 @@ void CMainDlg::GotoImage(EImagePosition ePos, int nFlags) { case POS_Next_Folder: { m_pFileList = m_pFileList->NextFolder(); + if (m_pFileList) + { + SetToast("Jumped > " + m_pFileList->CurrentDirectoryNameShort()); + } break; } case POS_Previous_Folder: { m_pFileList = m_pFileList->PrevFolder(); + if (m_pFileList) + { + SetToast("Jumped < " + m_pFileList->CurrentDirectoryNameShort()); + } break; } }