| 3001 | } |
| 3002 | |
| 3003 | shared_ptr<Image> ImageViewer::nthVisibleImage(size_t n) { |
| 3004 | shared_ptr<Image> lastVisible = nullptr; |
| 3005 | for (size_t i = 0; i < mImages.size(); ++i) { |
| 3006 | if (mImageButtonContainer->children()[i]->visible()) { |
| 3007 | lastVisible = mImages[i]; |
| 3008 | if (n == 0) { |
| 3009 | break; |
| 3010 | } |
| 3011 | --n; |
| 3012 | } |
| 3013 | } |
| 3014 | |
| 3015 | return lastVisible; |
| 3016 | } |
| 3017 | |
| 3018 | shared_ptr<Image> ImageViewer::imageByName(string_view imageName) { |
| 3019 | const auto id = imageId(imageName); |