display active peak-builds
[ardour.git] / gtk2_ardour / time_axis_view.cc
index cb03252d7f8b3c6f1d58154ad8afcfbf6c9f016c..9deb7eb3e880946e8c124ed397cde4428c23d6b1 100644 (file)
@@ -27,6 +27,7 @@
 #include "pbd/error.h"
 #include "pbd/convert.h"
 #include "pbd/stacktrace.h"
+#include "pbd/unwind.h"
 
 #include <gtkmm2ext/doi.h>
 #include <gtkmm2ext/utils.h>
@@ -82,7 +83,7 @@ Glib::RefPtr<Gtk::SizeGroup> TimeAxisView::midi_scroomer_size_group = Glib::RefP
 void
 TimeAxisView::setup_sizes()
 {
-       name_width_px = ceil (100. * ARDOUR_UI::config()->get_font_scale() / 102400.);
+       name_width_px = ceilf (100.f * ARDOUR_UI::ui_scale);
 }
 
 TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
@@ -102,6 +103,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
        , _y_position (0)
        , _editor (ed)
        , name_entry (0)
+       , ending_name_edit (false)
        , control_parent (0)
        , _order (0)
        , _effective_height (0)
@@ -696,6 +698,15 @@ TimeAxisView::end_name_edit (int response)
        if (!name_entry) {
                return;
        }
+
+       if (ending_name_edit) {
+               /* already doing this, and focus out or other event has caused 
+                  us to re-enter this code.
+               */
+               return;
+       }
+       
+       PBD::Unwinder<bool> uw (ending_name_edit, true);
        
        bool edit_next = false;
        bool edit_prev = false;
@@ -1187,7 +1198,7 @@ TimeAxisView::compute_heights ()
 
        window.add (one_row_table);
        test_button->set_name ("mute button");
-       test_button->set_text (_("M"));
+       test_button->set_text (S_("Mute|M"));
        test_button->set_tweaks (ArdourButton::TrackHeader);
 
        one_row_table.set_border_width (border_width);