plugins: imageviewer: Don't reload the image on the prev/next action if it's a single image.

Fixes image reloading when only a single image file is present among other files.

Change-Id: I6400af556d866ac96a3532712563bf01cbd29f68
This commit is contained in:
Roman Artiukhin 2025-02-05 19:46:39 +02:00
parent 849e8abe8d
commit 44e97b9ef6

View file

@ -633,7 +633,11 @@ static int scroll_bmp(struct image_info *info, bool initial_frame)
case IMGVIEW_LEFT: case IMGVIEW_LEFT:
if (entries > 1 && info->width <= LCD_WIDTH if (entries > 1 && info->width <= LCD_WIDTH
&& info->height <= LCD_HEIGHT) && info->height <= LCD_HEIGHT)
return change_filename(DIR_PREV); {
int result = change_filename(DIR_PREV);
if (entries > 1)
return result;
}
/* fallthrough */ /* fallthrough */
case IMGVIEW_LEFT | BUTTON_REPEAT: case IMGVIEW_LEFT | BUTTON_REPEAT:
pan_view_left(info); pan_view_left(info);
@ -642,7 +646,11 @@ static int scroll_bmp(struct image_info *info, bool initial_frame)
case IMGVIEW_RIGHT: case IMGVIEW_RIGHT:
if (entries > 1 && info->width <= LCD_WIDTH if (entries > 1 && info->width <= LCD_WIDTH
&& info->height <= LCD_HEIGHT) && info->height <= LCD_HEIGHT)
return change_filename(DIR_NEXT); {
int result = change_filename(DIR_NEXT);
if (entries > 1)
return result;
}
/* fallthrough */ /* fallthrough */
case IMGVIEW_RIGHT | BUTTON_REPEAT: case IMGVIEW_RIGHT | BUTTON_REPEAT:
pan_view_right(info); pan_view_right(info);