when tabbing between track/bus name entries, attempt to scroll appropriately (#4223)
git-svn-id: svn://localhost/ardour2/branches/3.0@9924 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -375,6 +375,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||
|
||||
void show_window ();
|
||||
|
||||
void ensure_time_axis_view_is_visible (const TimeAxisView& tav);
|
||||
void scroll_tracks_down_line ();
|
||||
void scroll_tracks_up_line ();
|
||||
|
||||
|
||||
@@ -697,6 +697,22 @@ Editor::entered_track_canvas (GdkEventCrossing */*ev*/)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::ensure_time_axis_view_is_visible (const TimeAxisView& tav)
|
||||
{
|
||||
double begin = tav.y_position();
|
||||
|
||||
double v = vertical_adjustment.get_value ();
|
||||
|
||||
if (begin < v || begin > v + _canvas_height) {
|
||||
/* try to put the TimeAxisView roughly central */
|
||||
if (begin >= _canvas_height/2.0) {
|
||||
begin -= _canvas_height/2.0;
|
||||
}
|
||||
vertical_adjustment.set_value (begin);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::tie_vertical_scrolling ()
|
||||
{
|
||||
|
||||
@@ -260,6 +260,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
|
||||
virtual framecnt_t current_page_frames() const = 0;
|
||||
virtual double canvas_height () const = 0;
|
||||
virtual void temporal_zoom_step (bool coarser) = 0;
|
||||
virtual void ensure_time_axis_view_is_visible (const TimeAxisView& tav) = 0;
|
||||
virtual void scroll_tracks_down_line () = 0;
|
||||
virtual void scroll_tracks_up_line () = 0;
|
||||
virtual void prepare_for_cleanup () = 0;
|
||||
|
||||
@@ -581,8 +581,9 @@ TimeAxisView::name_entry_key_release (GdkEventKey* ev)
|
||||
} while ((*i)->hidden());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(*i)->name_entry.grab_focus();
|
||||
_editor.ensure_time_axis_view_is_visible (**i);
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user