Skip to content

Commit

Permalink
added: real-time update to thumbnail bar; enhanced: if user drag-drop…
Browse files Browse the repository at this point in the history
… the same file to the viewer, do nothing
  • Loading branch information
d2phap committed Apr 19, 2018
1 parent ae5e8c9 commit da70033
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Source/ImageGlass/frmMain.cs
Expand Up @@ -106,6 +106,7 @@ private void picMain_DragOver(object sender, DragEventArgs e)
}

}

private void picMain_DragDrop(object sender, DragEventArgs e)
{
// Drag file from DESKTOP to APP
Expand All @@ -117,7 +118,12 @@ private void picMain_DragDrop(object sender, DragEventArgs e)
{
Prepare(filePath);
}
// The file is in current folder, just display the image
// The file is in current folder AND it is the viewing image
else if (GlobalSetting.CurrentIndex == imageIndex)
{
//do nothing
}
// The file is in current folder AND it is NOT the viewing image
else
{
GlobalSetting.CurrentIndex = imageIndex;
Expand Down Expand Up @@ -384,7 +390,12 @@ private void NextPic(int step, bool isKeepZoomRatio, bool isSkippingCache = fals

Application.DoEvents();
ImageSaveChange();
return;

//remove the old image data from cache
GlobalSetting.ImageList.Unload(GlobalSetting.CurrentIndex);

//update thumbnail
thumbnailBar.Items[GlobalSetting.CurrentIndex].Update();
}

Application.DoEvents();
Expand Down Expand Up @@ -1988,6 +1999,9 @@ private void sysWatch_Changed(object sender, FileSystemEventArgs e)
{
NextPic(0, true, true);
}

//update thumbnail
thumbnailBar.Items[imgIndex].Update();
}
// File change type = Created
else
Expand Down

0 comments on commit da70033

Please sign in to comment.