From 3538c47d255d56e335d731bca5c738a0f79956a1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 3 Dec 2009 00:14:24 +0000 Subject: [PATCH] Fix #2947. git-svn-id: svn://localhost/ardour2/branches/3.0@6266 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/time_axis_view_item.cc | 13 +++++++++---- gtk2_ardour/time_axis_view_item.h | 3 ++- gtk2_ardour/utils.cc | 1 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 32c7402017..53f8b39ce0 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -107,7 +107,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& group = new ArdourCanvas::Group (parent); - init (it_name, spu, base_color, start, duration, vis); + init (it_name, spu, base_color, start, duration, vis, true); } @@ -128,11 +128,11 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) group = new ArdourCanvas::Group (*parent); - init (other.item_name, other.samples_per_unit, c, other.frame_position, other.item_duration, other.visibility); + init (other.item_name, other.samples_per_unit, c, other.frame_position, other.item_duration, other.visibility, other.wide_enough_for_name); } void -TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis) +TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool wide) { item_name = it_name ; samples_per_unit = spu ; @@ -149,6 +149,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color const & ba _sensitive = true; name_pixbuf_width = 0; last_item_width = 0; + wide_enough_for_name = wide; if (duration == 0) { warning << "Time Axis Item Duration == 0" << endl ; @@ -554,7 +555,9 @@ TimeAxisViewItem::set_height (double height) } else { name_highlight->show(); - name_pixbuf->show(); + if (wide_enough_for_name) { + name_pixbuf->show(); + } } @@ -896,9 +899,11 @@ TimeAxisViewItem::reset_name_width (double /*pixel_width*/) } if (pb_width <= 0 || it_width <= NAME_X_OFFSET) { + wide_enough_for_name = false; name_pixbuf->hide(); return; } else { + wide_enough_for_name = true; name_pixbuf->show(); } diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index ece4b0b214..21726eb6ce 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -347,7 +347,7 @@ class TimeAxisViewItem : public Selectable TimeAxisViewItem (const TimeAxisViewItem& other); - void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis); + void init (const std::string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool); /** * Calculates some contrasting color for displaying various parts of this item, based upon the base color @@ -456,6 +456,7 @@ class TimeAxisViewItem : public Selectable uint32_t lock_handle_color_b ; uint32_t last_item_width; int name_pixbuf_width; + bool wide_enough_for_name; ArdourCanvas::Group* group; ArdourCanvas::SimpleRect* vestigial_frame; diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 2754ed0281..2c64594c97 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -991,7 +991,6 @@ pixbuf_from_ustring(const ustring& name, Pango::FontDescription* font, int clip_ empty_pixbuf = new Glib::RefPtr; *empty_pixbuf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, true, 8, clip_width, clip_height); } - cerr << "\n\nUSE EMPTY PIXBUF\n"; return *empty_pixbuf; }