Closed RainfallWithin closed 10 months ago
I have installed ImageGlass 7.0.7.26 and will continue using that version for the time being because it works correctly.
Here are screenshots of the expected behaviour from ImageGlass 7.0.7.26.
Before last image deletion:
After last image deletion:
Hi @RainfallWithin
Just asking if you checked the option: "Loop back viewer to the first image". The "Reached the last image" message only shown if this option is unchecked.
Hello d2phap,
Yes, I always have that option unchecked. I configure ImageGlass this way every time I install it. In ImageGlass 7.0.7.26 the screen becomes blank when deleting the last image, but in versions after that the deleted image stays on screen.
Here are my settings:
Thanks @RainfallWithin I will investigate on it
Thank you very much, d2phap. I will be patient. I'm happy to spend time testing anything you suggest.
I took a look at this, and it seems a little difficult to fix this "cleanly". Here are my findings for Phap to make the executive decision ...
The change is to frmMain.cs\NextPic(), currently at line 626-631. The code currently reads:
if (!Configs.IsSlideshow && !Configs.IsLoopBackViewer) {
//Reach end of list
if (tempIndex >= Local.ImageList.Length) {
ShowToastMsg(Configs.Language.Items[$"{Name}._LastItemOfList"], 1000);
return;
}
So in the "normal" case, when the end of the list is reached (loop back is OFF), then the last image is still displayed and the Toast message is on top.
My change, which provides the specific behavior requested by the OP, is:
if (!Configs.IsSlideshow && !Configs.IsLoopBackViewer) {
//Reach end of list
if (tempIndex >= Local.ImageList.Length) {
// Issue #837 : when the last image in the list has been deleted,
// and IsLoopBackViewer is off, do not keep showing the (now deleted) image.
if (Local.CurrentIndex >= Local.ImageList.Length) {
picMain.Image = null;
}
ShowToastMsg(Configs.Language.Items[$"{Name}._LastItemOfList"], 1000);
return;
}
With this code, in the "last image deleted" case, the image is cleared and the Toast message appears. The "normal" case is unchanged.
I say this isn't "clean" because the title bar still shows the details about the now deleted image, including inaccurate file counts (nn/nn). If I throw an UpdateStatusBar()
call in there, then the title bar is blanked except for even worse file counts (e.g. image 13/12).
I think the "clean" solution may be to call NextPic(-1)
instead of picMain.Image = null
. Now the "normal" case is still unchanged; for the "last image deleted" case, the display switches to the new "last" image, with the Toast message on top, and the title bar showing valid info. But doing so does not provided the solution as requested by the OP.
@fire-eggs, I really appreciate the time you have spent on this.
The change of code you have suggested is exactly what I was hoping for, and your worry about the title bar still showing the details of the now deleted last image is not a problem to me, and in fact might be useful in some circumstances.
I often sort and delete hundreds of images that are very similar in appearance. A blank screen when deleting the last image is very helpful. If the screen isn't blank after I've deleted the last image, I don't notice that I've reached the end and try to continue the sorting, with the belief that the image on the screen is a new image I've not yet reviewed.
I say this isn't "clean" because the title bar still shows the details about the now deleted image
I tested ImageGlass 7.0.7.26 which had the preferred behaviour (showing a blank screen after deleting the last image), and its behaviour matches what you described.
As you can see, the last image's name, 'Screenshot 620.png', still shows in the title bar after deletion.
This is something I never noticed until you pointed it out, and in my opinion is not an issue, and may in fact be helpful if I want to quickly check the name of the last image I deleted.
..., including inaccurate file counts (nn/nn). If I throw an UpdateStatusBar() call in there, then the title bar is blanked except for even worse file counts (e.g. image 13/12).
In ImageGlass 7.0.7.26, you can see from my screenshots that the file count stays at 2/2 when deleting the last image, even though there is 1 image left in the directory. I think it is completely OK to leave it this way. Technically I'm still on the last image when the screen has become blank, and the first thing myself and other users will do after reaching the end is to close ImageGlass, or select another image which will update the file count.
Thanks for the feedback! I should have confirmed the behavior of an older version.
Should be fixed in ImageGlass 9.0.9.1230
System information:
To Reproduce
Steps to reproduce the behavior:
Actual behavior:
ImageGlass continues to show the image that was deleted.
Expected behavior:
ImageGlass should show a blank screen with the message 'Reached the last image'.
Screenshots:
Before last image deletion:
After last image deletion:
Additional context:
Previous versions of ImageGlass correctly showed a blank screen after deleting the last image. ImageGlass Moon 7.6.7.12 still has the same bug.