"docs/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "e222246b4e7b60db7fe5fd27dc187bce446b5b56"
Commit b5511d2c authored by Davis King's avatar Davis King
Browse files

Made the image list select an image near the one you removed rather than

jump to the beginning.
parent ddaa9133
...@@ -129,11 +129,14 @@ remove_selected_images() ...@@ -129,11 +129,14 @@ remove_selected_images()
dlib::queue<unsigned long>::kernel_1a list; dlib::queue<unsigned long>::kernel_1a list;
lb_images.get_selected(list); lb_images.get_selected(list);
list.reset(); list.reset();
unsigned long min_idx = lb_images.size();
while (list.move_next()) while (list.move_next())
{ {
lb_images.unselect(list.element()); lb_images.unselect(list.element());
min_idx = std::min(min_idx, list.element());
} }
// remove all the selected items from metadata.images // remove all the selected items from metadata.images
dlib::static_set<unsigned long>::kernel_1a to_remove; dlib::static_set<unsigned long>::kernel_1a to_remove;
to_remove.load(list); to_remove.load(list);
...@@ -158,7 +161,9 @@ remove_selected_images() ...@@ -158,7 +161,9 @@ remove_selected_images()
lb_images.load(files); lb_images.load(files);
select_image(0); if (min_idx != 0)
min_idx--;
select_image(min_idx);
} }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment