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
|
|
@ -423,8 +423,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
return _drags;
|
||||
}
|
||||
|
||||
void maybe_autoscroll (bool, bool, bool);
|
||||
bool autoscroll_active() const;
|
||||
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; }
|
||||
void set_canvas_cursor (Gdk::Cursor*, bool save=false);
|
||||
|
|
@ -1800,7 +1801,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
ArdourCanvas::Rect autoscroll_boundary;
|
||||
|
||||
bool autoscroll_canvas ();
|
||||
void start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary);
|
||||
void start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary);
|
||||
void stop_canvas_autoscroll ();
|
||||
|
||||
/* trimming */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -373,12 +373,12 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
virtual ArdourCanvas::ScrollGroup* get_vscroll_group () const = 0;
|
||||
virtual ArdourCanvas::ScrollGroup* get_hvscroll_group () const = 0;
|
||||
|
||||
virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
|
||||
virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
|
||||
|
||||
virtual TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const = 0;
|
||||
|
||||
virtual void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>) = 0;
|
||||
virtual void set_current_movable (boost::shared_ptr<ARDOUR::Movable>) = 0;
|
||||
virtual void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>) = 0;
|
||||
virtual void set_current_movable (boost::shared_ptr<ARDOUR::Movable>) = 0;
|
||||
|
||||
virtual void center_screen (framepos_t) = 0;
|
||||
|
||||
|
|
@ -389,9 +389,10 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
virtual Gtkmm2ext::TearOff* tools_tearoff () const = 0;
|
||||
|
||||
virtual DragManager* drags () const = 0;
|
||||
virtual void maybe_autoscroll (bool, bool, bool from_headers) = 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;
|
||||
virtual bool autoscroll_active() const = 0;
|
||||
|
||||
virtual MouseCursors const * cursors () const = 0;
|
||||
virtual VerboseCursor * verbose_cursor () 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