diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-20 18:14:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-20 18:14:00 +0000 |
commit | 17b18acda3447214bd739107d9a46eecfaa6ef70 (patch) | |
tree | 695aa15c29117e101a0246ece8bbf25803b2cd67 /gtk2_ardour/time_axis_view_item.cc | |
parent | d7e728476a18bc024ae18705aa9d32ea21a1c4af (diff) |
a) use ink extents in most places where we used to use logical extents
for text sizing
b) add back scroll-wheel functionality to plugin parameter controls
git-svn-id: svn://localhost/trunk/ardour2@460 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r-- | gtk2_ardour/time_axis_view_item.cc | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index a9663b8630..270cbde0b8 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -867,35 +867,14 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width) void TimeAxisViewItem::reset_name_width (double pixel_width) { - int width; - int height; - ustring ustr; - Pango::FontDescription fd (NAME_FONT); - if (name_text == 0) { return; } - ustr = item_name; - int namelen = ustr.length(); - - Glib::RefPtr<Pango::Layout> layout = group->get_canvas()->create_pango_layout (ustr); - layout->set_font_description (fd); - - while (namelen) { - - layout->set_text (ustr); - layout->get_pixel_size (width, height); - - if (width < (pixel_width - NAME_X_OFFSET)) { - break; - } - - --namelen; - ustr = ustr.substr (0, namelen); - } + int width; + ustring ustr = fit_to_pixels (item_name, (int) floor (pixel_width - NAME_X_OFFSET), NAME_FONT, width); - if (namelen == 0) { + if (ustr.empty()) { name_text->hide (); |