Permalink
Browse files

mythgallery: Restore position after a delete in icon view

Move back to the same position after deleting and image. It was annoying to
have the selected item move to the first item after a delete especially when
deleting several images.
  • Loading branch information...
paul-h authored and Paul Harrison committed Nov 14, 2012
1 parent b91dc72 commit 464d32e7628074670b14657c52a27a98179eb93d
Showing with 7 additions and 0 deletions.
  1. +7 −0 mythplugins/mythgallery/mythgallery/iconview.cpp
@@ -1040,6 +1040,11 @@ void IconView::DoDeleteCurrent(bool doDelete)
{
ThumbItem *thumbitem = GetCurrentThumb();
int currPos = 0;
MythUIButtonListItem *item = m_imageList->GetItemCurrent();
if (item)
currPos = m_imageList->GetCurrentPos();
if (!thumbitem)
return;
@@ -1048,6 +1053,8 @@ void IconView::DoDeleteCurrent(bool doDelete)
GalleryUtil::Delete(fi);
LoadDirectory(m_currDir);
m_imageList->SetItemCurrent(currPos);
}
}

0 comments on commit 464d32e

Please sign in to comment.