diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 95c0696118..8cb55a1cf1 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -1692,6 +1693,7 @@ Editor::temporal_zoom_region () nframes64_t start = max_frames; nframes64_t end = 0; RegionSelection rs; + set tracks; get_regions_for_action (rs); @@ -1706,6 +1708,8 @@ Editor::temporal_zoom_region () if ((*i)->region()->last_frame() + 1 > end) { end = (*i)->region()->last_frame() + 1; } + + tracks.insert (&((*i)->get_time_axis_view())); } /* now comes an "interesting" hack ... make sure we leave a little space @@ -1733,6 +1737,15 @@ Editor::temporal_zoom_region () } temporal_zoom_by_frame (start, end, "zoom to region"); + + uint32_t per_track_height = (uint32_t) floor ((canvas_height - 10.0) / tracks.size()); + + for (set::iterator t = tracks.begin(); t != tracks.end(); ++t) { + (*t)->set_height (per_track_height); + } + + vertical_adjustment.set_value (std::max ((*tracks.begin())->y_position - 5.0, 0.0)); + zoomed_to_region = true; } diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index dd5e2d38d4..865c632121 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -92,7 +92,8 @@ ;; HOME ROW -(gtk_accel_path "/Editor/zoom-to-region" "<%SECONDARY%>z") +(gtk_accel_path "/Editor/zoom-to-region" "z") +;;(gtk_accel_path "/Editor/zoom-to-region-both-axes" "<%SECONDARY%>z") (gtk_accel_path "/Editor/undo" "<%PRIMARY%>z") (gtk_accel_path "/Editor/toggle-zoom" "<%TERTIARY%>z") (gtk_accel_path "/MouseMode/set-mouse-mode-zoom" "z") diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 794f8961d4..ceb8b4a99c 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -132,7 +132,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie controls_table.show_all (); controls_table.set_no_show_all (); - resizer.set_size_request (5, 5); + resizer.set_size_request (10, 10); resizer.signal_expose_event().connect (mem_fun (*this, &TimeAxisView::resizer_expose)); resizer.signal_button_press_event().connect (mem_fun (*this, &TimeAxisView::resizer_button_press)); resizer.signal_button_release_event().connect (mem_fun (*this, &TimeAxisView::resizer_button_release)); @@ -981,7 +981,8 @@ TimeAxisView::compute_controls_size_info () Gtk::Table one_row_table (1, 8); Button* buttons[5]; const int border_width = 2; - const int extra_height = (2 * border_width) + 2; // 2 pixels for the controls frame + const int extra_height = (2 * border_width) + 2 // 2 pixels for the controls frame + + 10; // resizer button window.add (one_row_table); @@ -1225,7 +1226,7 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev) bool TimeAxisView::resizer_expose (GdkEventExpose* event) { - resizer.get_window()->draw_rectangle (resizer.get_style()->get_bg_gc(resizer.get_state()), + resizer.get_window()->draw_rectangle (resizer.get_style()->get_fg_gc(STATE_ACTIVE), true, event->area.x, event->area.y,