From c6fd90dd169efe8b0e2e75a68cbb6be2b950aaa3 Mon Sep 17 00:00:00 2001 From: Dave Foster Date: Wed, 16 Dec 2020 17:59:25 -0500 Subject: [PATCH] Also search icon theme for image-loading-symbolic, updates #133 --- src/Thumbview.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Thumbview.cc b/src/Thumbview.cc index a62bcf3..52a5be6 100644 --- a/src/Thumbview.cc +++ b/src/Thumbview.cc @@ -154,18 +154,23 @@ Thumbview::Thumbview() view.set_search_equal_func (sigc::mem_fun (this, &Thumbview::search_compare)); // load loading image, which not all themes seem to provide + std::vector icon_names; + icon_names.push_back("image-loading"); + icon_names.push_back("image-loading-symbolic"); + std::vector sizes; sizes.push_back(64); sizes.push_back(48); sizes.push_back(24); sizes.push_back(16); - for (std::vector::const_iterator i = sizes.begin(); i != sizes.end(); i++) { - try { - this->loading_image = Gtk::IconTheme::get_default()->load_icon("image-loading", *i, (Gtk::IconLookupFlags)0); - break; - } catch (const Gtk::IconThemeError& e) { - } catch (const Gdk::PixbufError& e) { + for (std::vector::const_iterator i = icon_names.begin(); i != icon_names.end() && !this->loading_image; i++) { + for (std::vector::const_iterator j = sizes.begin(); j != sizes.end() && !this->loading_image; j++) { + try { + this->loading_image = Gtk::IconTheme::get_default()->load_icon(*i, *j, (Gtk::IconLookupFlags)0); + } catch (const Gtk::IconThemeError& e) { + } catch (const Gdk::PixbufError& e) { + } } }