mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 22:56:32 +01:00
[Summary] Added autoscroll support during track headers DnD operation
This commit is contained in:
parent
410bd658e3
commit
73709d1a04
4 changed files with 29 additions and 9 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue