X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view.cc;h=540dddcb3df715b7d1bc9008b323bf08206d9dce;hb=6d0208613db9dc6d93559392d227fa1a600d0030;hp=f97a1e8c515e9b5a2a3215da929c49126ae1de5b;hpb=43b6a7aca36b81c6ff95f33b7ff23f3413490c04;p=ardour.git diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index f97a1e8c51..540dddcb3d 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -58,7 +58,7 @@ #include "tooltips.h" #include "ui_config.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace Gtk; @@ -88,8 +88,7 @@ TimeAxisView::setup_sizes() } TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/) - : AxisView (sess) - , controls_table (5, 4) + : controls_table (5, 4) , controls_button_size_group (Gtk::SizeGroup::create (Gtk::SIZE_GROUP_BOTH)) , _name_editing (false) , height (0) @@ -148,20 +147,19 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie name_label.set_width_chars (12); set_tooltip (name_label, _("Track/Bus name (double click to edit)")); - Gtk::Entry* an_entry = new Gtkmm2ext::FocusEntry; - an_entry->set_name ("EditorTrackNameDisplay"); - Gtk::Requisition req; - an_entry->size_request (req); - name_label.set_size_request (-1, req.height); - name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE); - delete an_entry; + { + std::auto_ptr an_entry (new Gtkmm2ext::FocusEntry); + an_entry->set_name (X_("TrackNameEditor")); + Gtk::Requisition req; + an_entry->size_request (req); - name_hbox.pack_end (name_label, true, true); + name_label.set_size_request (-1, req.height); + name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE); + } // set min. track-header width if fader is not visible - name_hbox.set_size_request(name_width_px, -1); + name_label.set_size_request(name_width_px, -1); - name_hbox.show (); name_label.show (); controls_table.set_row_spacings (2); @@ -169,10 +167,11 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie controls_table.set_border_width (2); if (ARDOUR::Profile->get_mixbus() ) { - controls_table.attach (name_hbox, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); + controls_table.attach (name_label, 4, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); } else { - controls_table.attach (name_hbox, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); + controls_table.attach (name_label, 1, 2, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); } + controls_table.show_all (); controls_table.set_no_show_all (); @@ -294,6 +293,7 @@ TimeAxisView::hide () * @param y y position. * @param nth index for this TimeAxisView, increased if this view has children. * @param parent parent component. +* * @return height of this TimeAxisView. */ guint32 @@ -744,14 +744,7 @@ TimeAxisView::popup_display_menu (guint32 when) void TimeAxisView::set_selected (bool yn) { -#if 0 - /* end any name edit in progress */ - if (can_edit_name()) { - end_name_edit (string(), 0); - } -#endif - - if (yn == _selected) { + if (yn == selected()) { return; } @@ -936,6 +929,8 @@ TimeAxisView::order_selection_trims (ArdourCanvas::Item *item, bool put_start_on } } +// retuned rect is pushed back into the used_selection_rects list +// in TimeAxisView::show_selection() which is the only caller. SelectionRect * TimeAxisView::get_selection_rect (uint32_t id) { @@ -945,7 +940,9 @@ TimeAxisView::get_selection_rect (uint32_t id) for (list::iterator i = used_selection_rects.begin(); i != used_selection_rects.end(); ++i) { if ((*i)->id == id) { - return (*i); + SelectionRect* ret = (*i); + used_selection_rects.erase (i); + return ret; } }