ShowImage: Reset slide show delay if a user interferes

This change resets the delay when the user moves to next/previous image or
page within an image (e.g. TIFF) or deletes an image while a slide show is
running.

Fixes #16321
Change-Id: If0b8f4caef9c6aa4c0ad5bbb01d65bf43c1f831f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2967
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Humdinger 2020-06-29 16:32:35 +02:00 committed by humdinger
parent 4bfd65a2b7
commit a4462d205d
2 changed files with 13 additions and 0 deletions

View File

@ -1251,6 +1251,10 @@ ShowImageWindow::_ClosePrompt()
status_t
ShowImageWindow::_LoadImage(bool forward)
{
// If the user triggered a _LoadImage while in a slide show,
// make sure the new image is shown for the set delay:
_ResetSlideShowDelay();
BMessenger us(this);
status_t status = my_app->DefaultCache().RetrieveImage(
fNavigator.CurrentRef(), fNavigator.CurrentPage(), &us);
@ -1513,6 +1517,14 @@ ShowImageWindow::_StopSlideShow()
}
void
ShowImageWindow::_ResetSlideShowDelay()
{
if (fSlideShowRunner != NULL)
fSlideShowRunner->SetInterval(fSlideShowDelay);
}
void
ShowImageWindow::_UpdateRatingMenu()
{

View File

@ -101,6 +101,7 @@ private:
void _SetSlideShowDelay(bigtime_t delay);
void _StartSlideShow();
void _StopSlideShow();
void _ResetSlideShowDelay();
void _UpdateRatingMenu();