diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 53e6fa7f1..c9dc638a1 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1853,7 +1853,7 @@ void FileBrowser::openPrevImage() } } -void FileBrowser::selectImage(const Glib::ustring& fname) +void FileBrowser::selectImage(const Glib::ustring& fname, bool doScroll) { MYWRITERLOCK(l, entryRW); @@ -1891,7 +1891,10 @@ void FileBrowser::selectImage(const Glib::ustring& fname) MYWRITERLOCK_RELEASE(l); - setScrollPosition(x - (ww - tw) / 2, y); + if (doScroll) { + // Center thumb + setScrollPosition(x - (ww - tw) / 2, y); + } return; } @@ -1903,7 +1906,7 @@ void FileBrowser::openNextPreviousEditorImage (const Glib::ustring& fname, eRTNa { // let FileBrowser acquire Editor's perspective - selectImage (fname); + selectImage (fname, false); // now switch to the requested image if (nextPrevious == NAV_NEXT) { diff --git a/rtgui/filebrowser.h b/rtgui/filebrowser.h index 484d414ae..03c8b01e3 100644 --- a/rtgui/filebrowser.h +++ b/rtgui/filebrowser.h @@ -183,7 +183,7 @@ public: void openNextImage(); void openPrevImage(); - void selectImage(const Glib::ustring& fname); + void selectImage(const Glib::ustring& fname, bool doScroll); void copyProfile (); void pasteProfile (); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 5ebac5e12..8605b53d1 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -829,7 +829,7 @@ void FileCatalog::previewsFinishedUI () filepanel->loadingThumbs(M("PROGRESSBAR_READY"), 0); if (!imageToSelect_fname.empty()) { - fileBrowser->selectImage(imageToSelect_fname); + fileBrowser->selectImage(imageToSelect_fname, true); imageToSelect_fname = ""; } @@ -2144,7 +2144,7 @@ void FileCatalog::selectImage (Glib::ustring fname, bool clearFilters) imageToSelect_fname = fname; } else { // FileCatalog::filterChanged ();//this will be replaced by queue_draw() in fileBrowser->selectImage - fileBrowser->selectImage(fname); + fileBrowser->selectImage(fname, true); imageToSelect_fname = ""; } }