X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=inline;f=gtk2_ardour%2Ftime_axis_view.cc;h=e3695fb411c5ae51c264a58cefa5d2d453995c27;hb=0038820f473664a9a4fb524537cd846a9e024661;hp=a117bb64c1060424be547f2426edfb33fcf4dbb2;hpb=11cfdd4c6dcee2eb4c7fae8743576b42ffde246b;p=ardour.git diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index a117bb64c1..e3695fb411 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -82,7 +82,7 @@ Glib::RefPtr 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*/) @@ -568,8 +568,16 @@ TimeAxisView::set_height_enum (Height h, bool apply_to_selection) } void -TimeAxisView::set_height (uint32_t h) +TimeAxisView::set_height (uint32_t h, TrackHeightMode m) { + uint32_t lanes = 0; + if (m == TotalHeight) { + for (Children::iterator i = children.begin(); i != children.end(); ++i) { + if ( !(*i)->hidden()) ++lanes; + } + } + h /= (lanes + 1); + if (h < preset_height (HeightSmall)) { h = preset_height (HeightSmall); } @@ -590,6 +598,12 @@ TimeAxisView::set_height (uint32_t h) show_selection (_editor.get_selection().time); } + if (m != OnlySelf) { + for (Children::iterator i = children.begin(); i != children.end(); ++i) { + (*i)->set_height(h, OnlySelf); + } + } + _editor.override_visible_track_count (); } @@ -1173,7 +1187,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);