Makes Next/Prev buttons work same as F3/F4 #5183

This commit is contained in:
Morgan Hardwood
2019-03-10 23:26:17 +01:00
parent 2155cf76f0
commit b29651c5f2
3 changed files with 9 additions and 6 deletions

View File

@@ -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); MYWRITERLOCK(l, entryRW);
@@ -1891,7 +1891,10 @@ void FileBrowser::selectImage(const Glib::ustring& fname)
MYWRITERLOCK_RELEASE(l); MYWRITERLOCK_RELEASE(l);
if (doScroll) {
// Center thumb
setScrollPosition(x - (ww - tw) / 2, y); setScrollPosition(x - (ww - tw) / 2, y);
}
return; return;
} }
@@ -1903,7 +1906,7 @@ void FileBrowser::openNextPreviousEditorImage (const Glib::ustring& fname, eRTNa
{ {
// let FileBrowser acquire Editor's perspective // let FileBrowser acquire Editor's perspective
selectImage (fname); selectImage (fname, false);
// now switch to the requested image // now switch to the requested image
if (nextPrevious == NAV_NEXT) { if (nextPrevious == NAV_NEXT) {

View File

@@ -183,7 +183,7 @@ public:
void openNextImage(); void openNextImage();
void openPrevImage(); void openPrevImage();
void selectImage(const Glib::ustring& fname); void selectImage(const Glib::ustring& fname, bool doScroll);
void copyProfile (); void copyProfile ();
void pasteProfile (); void pasteProfile ();

View File

@@ -829,7 +829,7 @@ void FileCatalog::previewsFinishedUI ()
filepanel->loadingThumbs(M("PROGRESSBAR_READY"), 0); filepanel->loadingThumbs(M("PROGRESSBAR_READY"), 0);
if (!imageToSelect_fname.empty()) { if (!imageToSelect_fname.empty()) {
fileBrowser->selectImage(imageToSelect_fname); fileBrowser->selectImage(imageToSelect_fname, true);
imageToSelect_fname = ""; imageToSelect_fname = "";
} }
@@ -2144,7 +2144,7 @@ void FileCatalog::selectImage (Glib::ustring fname, bool clearFilters)
imageToSelect_fname = fname; imageToSelect_fname = fname;
} else { } else {
// FileCatalog::filterChanged ();//this will be replaced by queue_draw() in fileBrowser->selectImage // FileCatalog::filterChanged ();//this will be replaced by queue_draw() in fileBrowser->selectImage
fileBrowser->selectImage(fname); fileBrowser->selectImage(fname, true);
imageToSelect_fname = ""; imageToSelect_fname = "";
} }
} }