[Summary] Added autoscroll support during track headers DnD operation

This commit is contained in:
GZharun 2014-09-09 17:20:44 +03:00
parent 410bd658e3
commit 73709d1a04
4 changed files with 29 additions and 9 deletions

View file

@ -424,6 +424,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
}
void maybe_autoscroll (bool, bool, bool);
void start_autoscroll_for_headers ();
bool autoscroll_active() const;
Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; }

View file

@ -575,6 +575,19 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers)
}
}
void
Editor::start_autoscroll_for_headers ()
{
if (autoscroll_active () ) {
return;
}
Gtk::Allocation alloc = controls_layout.get_allocation ();
ArdourCanvas::Rect scrolling_boundary = ArdourCanvas::Rect (alloc.get_x(), alloc.get_y(), alloc.get_x() + alloc.get_width(), alloc.get_y() + alloc.get_height());
start_canvas_autoscroll (false/*horizontal disabled*/, true/*vertical enabled*/, scrolling_boundary);
}
bool
Editor::autoscroll_active () const
{

View file

@ -390,6 +390,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual DragManager* drags () const = 0;
virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0;
virtual void start_autoscroll_for_headers () = 0;
virtual void stop_canvas_autoscroll () = 0;
virtual bool autoscroll_active() const = 0;

View file

@ -1161,12 +1161,17 @@ RouteTimeAxisView::handle_route_drag_begin (const Glib::RefPtr<Gdk::DragContext>
_editor.get_selection().add(this);
}
// enable autoscroll
_editor.start_autoscroll_for_headers ();
//GZ TO-DO: Draw DnD icon for track header
}
void
RouteTimeAxisView::handle_route_drag_end(const Glib::RefPtr<Gdk::DragContext>& context)
{
// disable autoscroll
_editor.stop_canvas_autoscroll ();
}
void