Fix editor sizing issue introduced in 4dc65e66
[ardour.git] / gtk2_ardour / time_axis_view.cc
index 2de7934f5c2348302b0ff136805b2823c91a18b9..65118e75b9ad3426c829c8efbac15e14076d964c 100644 (file)
@@ -23,6 +23,8 @@
 #include <string>
 #include <list>
 
+#include <boost/smart_ptr/scoped_ptr.hpp>
+
 #include <gtkmm/separator.h>
 
 #include "pbd/error.h"
@@ -149,10 +151,9 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        set_tooltip (name_label, _("Track/Bus name (double click to edit)"));
 
        {
-               std::auto_ptr<Gtk::Entry> an_entry (new FocusEntry);
+               boost::scoped_ptr<Gtk::Entry> an_entry (new FocusEntry);
                an_entry->set_name (X_("TrackNameEditor"));
-               Gtk::Requisition req;
-               an_entry->size_request (req);
+               Gtk::Requisition req = an_entry->size_request ();
 
                name_label.set_size_request (-1, req.height);
                name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
@@ -199,9 +200,9 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        controls_ebox.signal_leave_notify_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_leave));
        controls_ebox.show ();
 
-       time_axis_sample.set_shadow_type (Gtk::SHADOW_NONE);
-       time_axis_sample.add(top_hbox);
-       time_axis_sample.show();
+       time_axis_frame.set_shadow_type (Gtk::SHADOW_NONE);
+       time_axis_frame.add(top_hbox);
+       time_axis_frame.show();
 
        HSeparator* separator = manage (new HSeparator());
        separator->set_name("TrackSeparator");
@@ -213,7 +214,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        midi_scroomer_size_group->add_widget (scroomer_placeholder);
 
        time_axis_vbox.pack_start (*separator, false, false);
-       time_axis_vbox.pack_start (time_axis_sample, true, true);
+       time_axis_vbox.pack_start (time_axis_frame, true, true);
        time_axis_vbox.show();
        time_axis_hbox.pack_start (time_axis_vbox, true, true);
        time_axis_hbox.show();
@@ -660,7 +661,7 @@ TimeAxisView::end_name_edit (std::string str, int next_dir)
 
                                RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*>(*i);
 
-                               if (rtav && (!rtav->is_track() || rtav->track()->rec_enable_control()->get_value())) {
+                               if (rtav && rtav->is_track() && rtav->track()->rec_enable_control()->get_value()) {
                                        continue;
                                }
 
@@ -691,7 +692,7 @@ TimeAxisView::end_name_edit (std::string str, int next_dir)
 
                                RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*>(*i);
 
-                               if (rtav && (!rtav->is_track() || rtav->track()->rec_enable_control()->get_value())) {
+                               if (rtav && rtav->is_track() && rtav->track()->rec_enable_control()->get_value()) {
                                        continue;
                                }
 
@@ -757,14 +758,14 @@ TimeAxisView::set_selected (bool yn)
        AxisView::set_selected (yn);
 
        if (_selected) {
-               time_axis_sample.set_shadow_type (Gtk::SHADOW_IN);
-               time_axis_sample.set_name ("MixerStripSelectedFrame");
+               time_axis_frame.set_shadow_type (Gtk::SHADOW_IN);
+               time_axis_frame.set_name ("MixerStripSelectedFrame");
                controls_ebox.set_name (controls_base_selected_name);
                controls_vbox.set_name (controls_base_selected_name);
                time_axis_vbox.set_name (controls_base_selected_name);
        } else {
-               time_axis_sample.set_shadow_type (Gtk::SHADOW_NONE);
-               time_axis_sample.set_name (controls_base_unselected_name);
+               time_axis_frame.set_shadow_type (Gtk::SHADOW_NONE);
+               time_axis_frame.set_name (controls_base_unselected_name);
                controls_ebox.set_name (controls_base_unselected_name);
                controls_vbox.set_name (controls_base_unselected_name);
                time_axis_vbox.set_name (controls_base_unselected_name);
@@ -772,7 +773,7 @@ TimeAxisView::set_selected (bool yn)
                hide_selection ();
        }
 
-       time_axis_sample.show();
+       time_axis_frame.show();
 }
 
 void
@@ -818,8 +819,9 @@ TimeAxisView::show_selection (TimeSelection& ts)
        double x1;
        double x2;
        double y2;
-       SelectionRect *rect;    time_axis_sample.show();
+       SelectionRect *rect;
 
+       time_axis_frame.show();
 
        for (Children::iterator i = children.begin(); i != children.end(); ++i) {
                if (!(*i)->selected () && !(*i)->propagate_time_selection ()) {