diff options
author | Robin Gareus <robin@gareus.org> | 2019-11-09 01:35:55 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-11-09 05:59:55 +0100 |
commit | a701882e665d71be9fdb14352332dafdc66e664b (patch) | |
tree | 00aea0f7dafc3498b0350eec264f8023fc03354c /gtk2_ardour | |
parent | 3cecc3d26bb746aa8b2e6d22811e936e8925d61a (diff) |
Add convenience methods to test for active drags
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.h | 3 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 12 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a560478c7e..5dab984f38 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -493,6 +493,9 @@ public: return _drags; } + bool drag_active () const; + bool preview_video_drag_active () const; + void maybe_autoscroll (bool, bool, bool); bool autoscroll_active() const; diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 2486078a25..437bb3e526 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -588,6 +588,18 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool from_headers) } bool +Editor::drag_active () const +{ + return _drags->active(); +} + +bool +Editor::preview_video_drag_active () const +{ + return false; +} + +bool Editor::autoscroll_active () const { return autoscroll_connection.connected (); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 0093dc3216..2723726850 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -447,6 +447,8 @@ public: virtual TrackViewList const & get_track_views () const = 0; virtual DragManager* drags () const = 0; + virtual bool drag_active () const = 0; + virtual bool preview_video_drag_active () const = 0; virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0; virtual void stop_canvas_autoscroll () = 0; virtual bool autoscroll_active() const = 0; |