13
0

add extra (default-ed) argument to ::get_icon_path() to allow it to be used to look for icon-related but non-image files

This commit is contained in:
Paul Davis 2014-09-10 19:39:15 -04:00
parent 9b1cd13706
commit 233d2e8530
2 changed files with 7 additions and 4 deletions

View File

@ -676,11 +676,14 @@ ARDOUR_UI_UTILS::get_icon_sets ()
}
std::string
ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set)
ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_image)
{
std::string data_file_path;
string name = cname;
name += X_(".png");
if (is_image) {
name += X_(".png");
}
Searchpath spath(ARDOUR::ardour_data_search_path());
@ -693,7 +696,7 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set)
find_file (spath, name, data_file_path);
}
if (data_file_path.empty()) {
if (is_image && data_file_path.empty()) {
if (!icon_set.empty() && icon_set != _("default")) {
warning << string_compose (_("icon \"%1\" not found for icon set \"%2\", fallback to default"), cname, icon_set) << endmsg;

View File

@ -80,7 +80,7 @@ bool emulate_key_event (Gtk::Widget*, unsigned int);
Glib::RefPtr<Gdk::Pixbuf> get_xpm (std::string);
std::vector<std::string> get_icon_sets ();
std::string get_icon_path (const char*, std::string icon_set = std::string());
std::string get_icon_path (const char*, std::string icon_set = std::string(), bool is_image = true);
Glib::RefPtr<Gdk::Pixbuf> get_icon (const char*, std::string icon_set = std::string());
static std::map<std::string, Glib::RefPtr<Gdk::Pixbuf> > xpm_map;
const char* const *get_xpm_data (std::string path);