fix audio clock field widths, change minsec display to include fractional seconds...
[ardour.git] / gtk2_ardour / utils.cc
index 7e58d0e2f7ef3ee9c7f0b5fe3f8cd29520ab6c99..76b237713adba8725cd99160f617e6faab8811ea 100644 (file)
@@ -71,8 +71,7 @@ fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font
                        break;
                }
                
-               ustr.erase (last);
-               --last;
+               ustr.erase (last--);
        }
 
        return ustr;
@@ -469,6 +468,22 @@ get_xpm (std::string name)
        return (xpm_map[name]);
 }
 
+Glib::RefPtr<Gdk::Pixbuf>      
+get_icon (const char* cname)
+{
+       string name = cname;
+       name += X_(".png");
+
+       string path = ARDOUR::find_data_file (name, "icons");
+
+       if (path.empty()) {
+               fatal << string_compose (_("cannot find icon image for %1"), name) << endmsg;
+               /*NOTREACHED*/
+       }
+
+       return Gdk::Pixbuf::create_from_file (path);
+}
+
 string
 longest (vector<string>& strings)
 {