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:
Paul Davis
2011-07-25 20:28:51 +00:00
parent 372137f373
commit af7ba3347c
4 changed files with 20 additions and 1 deletions

View File

@@ -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 ();

View File

@@ -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 ()
{

View File

@@ -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;

View File

@@ -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;